简体   繁体   English

从dd.mm.yyyy格式的ms访问中选择日期

[英]select the date from ms access in dd.mm.yyyy format

I want to select the data from the database using select command but the result is showing in yy.mm.dd format while i want the result in dd mm yy format I am using the following commad 我想使用select命令从数据库中选择数据,但结果显示为yy.mm.dd格式,而我希望结果为dd mm yy格式我正在使用以下commad

  select  date from table1 order by date desc;

how can i get the date in dd mm yyyy format please help me 我怎么能得到dd mm yyyy格式的日期请帮帮我

您需要用户日期格式化功能

select format([date], "dd.mm.yyyy") from table1 order by [date] desc;

You should avoid date as a field Name, since it is a reserved word. 您应该将日期作为字段名称来避免,因为它是保留字。

select  Format([date],"dd/mm/yyyy") as Dt from table1 order by [date] desc;

My feeling is that you should conserve the field as a date until the very end, and just render it in the final form/report/whatever. 我的感觉是你应该把这个领域保存为一个日期直到最后,并将其呈现在最终形式/报告/中。 Using Format() will change it to a string and it will not sort or add properly anymore. 使用Format()会将其更改为字符串,它将不再排序或正确添加。 In Access, for instance, one would leave is as it is and rather modify the Format property of the Control bound to that field. 例如,在Access中,将保留原样,而是修改绑定到该字段的Control的Format属性。 Since you tagged your question with [Java], I can't tell you more... 既然你用[Java]标记了你的问题,我不能告诉你更多......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM