Input Mask without Year for date

陌路散爱 提交于 2019-12-25 07:11:51

问题


Could anyone help me in inserting a input mask formula for date in a access form textbox

that shouldnot take year

which only take date and month in the below format :

DD/MM

Not in DD/MM/YY

Thanks for help in advance


回答1:


99/99 would work.




回答2:


I'd suggest that you probably shouldn't use a date mask like this with data stored in a date field.

If you input like "06/13" that will be stored as 06/13/2009 today and as 6/13/2010 a year from now. That is, all entry that doesn't specify a year will be stored as the current year. To use the resulting data, you'll always have to strip off the year, as it won't mean anything otherwise.

Thus you'll be always parsing with Format() or use Month() and Day() and that means any indexes on the field will be of no use. If you're going to have to do that, you really don't get much benefit from using a date field, and should consider storing the data as a literal string (suitably validated), or using two fields to store the month and day (again, suitably validated).



来源:https://stackoverflow.com/questions/1194493/input-mask-without-year-for-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!