nicklewe
13th November 2002, 19:34
Hello,
another little sql problem:
I have got an select statement:
select mytable.*
from mytable
order by mytable.datefield, mytable.orderno, mytable.posno
selectdo
|do something with the records found
selectempty
| nothing found
endselect
Now all is straight forward and simple, but -
the first order field is a tcdate field -
when the order by is executed it will obviously sort by the date and then by the orderno and posno fields. But i need baan to sort by using the corresponding calender week of the date and not the date as is stored.
Example data:
Date Orderno Posno
01.02.2002 123456 20
02.02.2002 123456 10
10.10.2002 111111 10
i need to sort by orderno,posno within the same calender week, therefore giving:
02.02.2002 123456 10
01.02.2002 123456 20
10.10.2002 111111 10
does anybody know how i can do this?
regards and thanks to anyone who has read the problem
Nick LeWe
another little sql problem:
I have got an select statement:
select mytable.*
from mytable
order by mytable.datefield, mytable.orderno, mytable.posno
selectdo
|do something with the records found
selectempty
| nothing found
endselect
Now all is straight forward and simple, but -
the first order field is a tcdate field -
when the order by is executed it will obviously sort by the date and then by the orderno and posno fields. But i need baan to sort by using the corresponding calender week of the date and not the date as is stored.
Example data:
Date Orderno Posno
01.02.2002 123456 20
02.02.2002 123456 10
10.10.2002 111111 10
i need to sort by orderno,posno within the same calender week, therefore giving:
02.02.2002 123456 10
01.02.2002 123456 20
10.10.2002 111111 10
does anybody know how i can do this?
regards and thanks to anyone who has read the problem
Nick LeWe