select year(date1+numberofdays), week(date1+numberofdays), sum(qty) from pub.table group by year(date1+numberofdays), week(date1+numberofdays)
select year(date1+numberofdays), week(date1+numberofdays-1), sum(qty) from pub.table group by year(date1+numberofdays), week(date1+numberofdays-1)
select year(date1+numberofdays), week(date1+numberofdays-1), qty from pub.table
Is that your exact code? Could week perhaps be an internal function that you're calling by mistake. The progress built in function for getting day of week (with 1 being sunday) is weekday(date) and not week(date)?
Hi,
I'm using the ODBC interface, forgot to mention that. I'm trying to get week of year, not day of week, so week() should be the correct function to use.
The query is a bit simplified.