>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--