Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Order By
Message
De
26/01/2003 10:29:14
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00745530
Message ID:
00745535
Vues:
22
This message has been marked as the solution to the initial question of the thread.
Mel, just ORDER BY MyTable.HiredDate would order in correct chronological order Year-Month-Day. Or have I misunderstood the question? If you want to exclude the year from the HiredDate to get all month/day records together then you could use the following as a possible solution:

SELECT Fld1, Fld2, FldX, SUBSTR( DTOS( MyTable.HiredDate ), 5 ) AS MnthDay FROM MyTable ORDER BY MnthDay

Another option could be:

SELECT Fld1, Fld2, FldX, MONTH( HiredDate ) AS nMonth, DAY( HiredDate ) AS nDAY FROM MyTable ORDER BY nMonth, nDay


>In building a Select-SQL statement, I need the Order By to actaully be ordered by the Month and then Day of a date field similar to:
>
>Order By MONTH(MyTable.HiredDate), DAY(MyTable.HiredDate)
>
>Anyone know how to do something like this?
>
>I would prefer not to have to create a temp index to do this.
>
>Thanks,
>Mel Cummings
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform