Hi Folks
I managed to find a nice formula for 'Crystal' that selected data from my DB that had a date within the last 12 months. I put this in the 'Select Expert' for the 'Date' field:
{MyTable.Date} in dateserial(year(currentdate - day(currentdate)),
month(currentdate-day(currentdate))-11,01) to
date(year(currentdate - day(currentdate)),
month(currentdate-day(currentdate)),day(currentdate-day(currentdate)))
Basically this acts like a moving window for data from the last 12 months.
This was all fine and dandy until today when I tried to do the same thing using a SQL statement. Does anyone know how I can replicate this in SQL?
Cheers!
I managed to find a nice formula for 'Crystal' that selected data from my DB that had a date within the last 12 months. I put this in the 'Select Expert' for the 'Date' field:
{MyTable.Date} in dateserial(year(currentdate - day(currentdate)),
month(currentdate-day(currentdate))-11,01) to
date(year(currentdate - day(currentdate)),
month(currentdate-day(currentdate)),day(currentdate-day(currentdate)))
Basically this acts like a moving window for data from the last 12 months.
This was all fine and dandy until today when I tried to do the same thing using a SQL statement. Does anyone know how I can replicate this in SQL?
Cheers!