Ms Access中的日期/时间格式 [英] Date/Time format in Ms Access

查看:80
本文介绍了Ms Access中的日期/时间格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我的桌子上有一个叫做dateofbirth的字段.当我通过文本框输入2/2/2012之类的数据时,它能够将数据保存在表中但以时间格式保存,如何以日期格式显示(存储)值

Hey guys i have table with a field called dateofbirth. When i enter data like 2/2/2012 through textbox its able to save the data in the table but in time format, how can i display(store) the value in date format

推荐答案

请参阅:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx [ ^ ].

这应该足以解决问题.如果不是,您还需要以下内容: Microsoft Q209354 .

—SA
Please see:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx[^],
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx[^],
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[^].

This should be more than enough to solve the problem. If not, you would also need this: Microsoft Q209354.

—SA


请参阅以下文章:
http://office. microsoft.com/en-us/access-help/format-the-date-and-time-field-in-access-HA010341474.aspx [ http://www.techonthenet.com/access/tables/format_date.php [ ^ ]
Please, see these articles:
http://office.microsoft.com/en-us/access-help/format-the-date-and-time-field-in-access-HA010341474.aspx[^]
http://www.techonthenet.com/access/tables/format_date.php[^]


使用参数化在您的VB应用程序中查询.关于日期时间格式的访问真的很糟糕-可以交换月份和日期,可以忽略区域设置!
接下来,当您在其中打开表时,不必在意Access中显示的值.请注意您的VB应用程序正确格式化了该值,例如带有ToString("MM/dd/YYYY").
Use parameterized queries in your VB application. Access is really terrible when it comes to date time formats - month and day can be swapped around, the regional settings can be ignored!
Next, do not care for the displayed value in Access when you open the table there. Take care that your VB application formats the value correctly, e.g. with a ToString("MM/dd/YYYY").


这篇关于Ms Access中的日期/时间格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆