[Q] MS Access Database Date Format

snoopy

新手上路
注册
2002-07-20
消息
7,077
荣誉分数
1
声望点数
0
Hey all, I met with a problem and can't solve it.

Currently, I have a field in the table stored Date/Time data. In table's design view, I set the Format as dd/mm/yy and set the Input Mask as 99/99/00. To match the table, I set up a textbox in the form, and set the textbox format to dd/mm/yy and the Input Mask as 99/99/00. Now something weird happens: After I enter the date as 30/08/04 (which is Aug. 30th/2004) and move on to the next object, the data changes automatically to 04/08/30! I don't know why that happens and how to prevent the MS Access from changing the data automatically. Could anyone give me some tips or suggestions?

Thanks a ton!
:thanks: :thanks:
 
pick a format first
then click on the lil .... beside input mask
it will notice you if you want to save it now
choose yes
then the input mask wizard will pop up

choose edit list

Description: HotDog Date
Input Mask: 99/99/1999
Placeholder: _
Sample Data: 99/99/9999
Mask Type: Date-Time

Then close it
click on finish
it will be done

but i am not sure if this one works on you.

try it then give me some feedback
 
thanx thanx
i'll try that as soon as possible!
:thanks:
 
You may also want to check the date format in your windows settings.
 
I remembered there was a short date time formate like dd/mm/yyyy, maybe you need to edit it as dd/mm/yy, then save as the input format? I will go and try if it works...
 
最初由 snoopy 发布
still not working
:crying:

I think I might solve this problem...If the field type that you chose was data/time; it caused the problem that you described. I changed the field type as text, and then set up the Input Mask as 99/99/00; the problem seemed disappeared. Try it...
 
最初由 Stanley 发布


I think I might solve this problem...If the field type that you chose was data/time; it caused the problem that you described. I changed the field type as text, and then set up the Input Mask as 99/99/00; the problem seemed disappeared. Try it...

Thanks~
the reason why i wanna keep it as date/time is b'coz i wanna do some queries on date/time...
 
最初由 snoopy 发布


Thanks~
the reason why i wanna keep it as date/time is b'coz i wanna do some queries on date/time...

actully, you can do a Format Function in the query to set up the date/time formate. The syntax is format([field name],"dd/mm/yy").
 
后退
顶部