By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 1,221 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

need help on order

P: n/a
I format the ShipDate to Format([ShipDate], "Short Date") in a query, that
is alright, the problem is that no matter I choose ascend or descend, I just
cannot make the ShipDate in any order, it is for example like this:

15.09.2003
05.10.2004
15.10.2004
15.09.2004
.....
strangely, the last date "15.09.2004" should be between the first and the
third dates...

thanks in advance

Paul


Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
If this is in the query design interface, do not use Format(). Format()
returns a string, not a date.

If you are including the literal date in a string (such as a SQL statement,
3rd argument of DLookUp(), the WhereCondition of OpenReport, or the Filter
of a form), the you must format the date as mm/dd/yyyy and delimit with #.
Try:
Format([ShipDate], "\#mm\/dd\/yyyy\#)

More information:
International Date Formats in Access
at:
http://members.iinet.net.au/~allenbrowne/ser-36.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Paul T. Rong" <et***@hotmail.com> wrote in message
news:rh******************@news.chello.at...
I format the ShipDate to Format([ShipDate], "Short Date") in a query, that
is alright, the problem is that no matter I choose ascend or descend, I
just
cannot make the ShipDate in any order, it is for example like this:

15.09.2003
05.10.2004
15.10.2004
15.09.2004
....

strangely, the last date "15.09.2004" should be between the first and the
third dates...

Nov 13 '05 #2

P: n/a
Allen,

Thanks for your help and the website you recommended. The problem is solved.

Paul

"Allen Browne" <Al*********@SeeSig.Invalid> 写入消息新闻
:41***********************@per-qv1-newsreader-01.iinet.net.au...
If this is in the query design interface, do not use Format(). Format()
returns a string, not a date.

If you are including the literal date in a string (such as a SQL statement, 3rd argument of DLookUp(), the WhereCondition of OpenReport, or the Filter
of a form), the you must format the date as mm/dd/yyyy and delimit with #.
Try:
Format([ShipDate], "\#mm\/dd\/yyyy\#)

More information:
International Date Formats in Access
at:
http://members.iinet.net.au/~allenbrowne/ser-36.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Paul T. Rong" <et***@hotmail.com> wrote in message
news:rh******************@news.chello.at...
I format the ShipDate to Format([ShipDate], "Short Date") in a query, that is alright, the problem is that no matter I choose ascend or descend, I
just
cannot make the ShipDate in any order, it is for example like this:

15.09.2003
05.10.2004
15.10.2004
15.09.2004
....

strangely, the last date "15.09.2004" should be between the first and the third dates...


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.