>DATE, HOURS, CODE, ACCOUNT
>1/1/99, 10, A, 123456
>1/2/99, 15, B, 789123
>1/3/99, 8, A, 123456
>1/4/99, 5, B, 951753
>
>TOTALS:
> 18, A, 123456
> 15, B, 789123
> 5, B, 951753
>
>How do I acheive to get the TOTALS: grouped as they are in the above example? To complicate it even futher the user selects a date range.
>For example 1/1/99 to 1/2/99 OR 1/1/99 to 1/4/99.
>
>Thanks in advance for any help.
>
>Sanjay
For your date ranges, (adding to Nick's reply):
<B>ldBegin = {^1999/01/01}
ldEnd = {^1999/01/04}</B>
SELECT sum(hours), code, account ;
FROM myTable ;
<B>WHERE BETWEEN(date,ldBegin,ldEnd)</B> ;
GROUP BY account
BTW, you really shouldn't use the reserved word DATE as a field name.