Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to order this?
Message
 
 
À
28/07/2001 21:38:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00536932
Message ID:
00536933
Vues:
8
>Hi,
> How it should be ?
>
>My query result contains of 4 group, A,B,C and D. Each of these will have it's date fields beside of D. I want my cursor to be ordered by date, and then group. However, the group D must always at the last. How to do this?
>I need this to get the stocks' cost to calculate stocks' value using LIFO/FIFO method. Again, The query result will contain more than one itemcode. Any ideas?
>
>Thank you

Try this
SELECT groupfield, datefield, ;
      IIF(groupfield = "D", 2, 1) AS sortfield ;
   ORDER BY sortfiled, datefield, groupfield

or

SELECT groupfield, datefield, ;
      IIF(groupfield = "D", DATE(9999,12,31), datefield) AS sortfield ;
   ORDER BY sortfiled, groupfield
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform