简体   繁体   中英

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  date from table1 order by date desc;

how can i get the date in dd mm yyyy format please help me

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

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. In Access, for instance, one would leave is as it is and rather modify the Format property of the Control bound to that field. Since you tagged your question with [Java], I can't tell you more...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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