Well you're missing 1/2 of the BETWEEN clause...
AND ((dbo_SDB_APPHISTORY.STARTTIME) Between GetDate() AND DateAdd("d",-180, Getdate())
Leslie
2010-02-09 15:20:02
Well you're missing 1/2 of the BETWEEN clause...
AND ((dbo_SDB_APPHISTORY.STARTTIME) Between GetDate() AND DateAdd("d",-180, Getdate())
You can use Date() instead of GetDate:
DateAdd("d",-180, Date())
Date() is quite happy with:
Date()-180
DateAdd will accept "m", if you wish to consider months:
DateAdd("m",-6, Date())
Watch out for date formats and locale.