Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems w. SQL ORDER BY on Date type fld
Message
From
28/08/2003 11:58:15
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/08/2003 11:44:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00824236
Message ID:
00824243
Views:
19
>I have a table that has several date fields. I have a SQL Query that does ORDER BY on one of date fields in table. The BROWSE window is NOT showing a properly sorted recordset sorted on this ORDER BY (date). Why?
>
>TABLE: Lar_sum
>Field: rcvdte (Date)
>
>Here is what comes out of SQL Query:
>
>SELECT rcvdte from lar_sum ;
> WHERE rcvdte < DTOT({^1996-01-01}) ;
> AND !EMPTY(rcvdte) ORDER BY rcvdte ASC
>
>11/13/01
>10/06/99
>10/12/99
>04/12/79
>08/02/83
>
>...
>...
>
>What is going on here?
>
>Fz

Donald,
Question: Why are you converting to datetime to check on date ?
SELECT rcvdte from lar_sum ;
   WHERE rcvdte < {^1996-01-01} ;
   AND rcvdte # {} ;
   ORDER BY rcvdte ASC
Converting to datetime wouldn't have a negative impact though.

Set century on

and retest. Those results might be from very old years like 1801, 1601...
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform