Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems w. SQL ORDER BY on Date type fld
Message
De
28/08/2003 11:58:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/08/2003 11:44:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00824236
Message ID:
00824243
Vues:
18
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform