views:

45

answers:

2
A: 

Well you're missing 1/2 of the BETWEEN clause...

AND ((dbo_SDB_APPHISTORY.STARTTIME) Between GetDate() AND DateAdd("d",-180, Getdate())

Leslie
GETDATE() dont seem to be recognised in ACCESS 2007 SQL View, NOW() seems fine.Any alternatives
MalsiaPro
The Access/Jet/ACE function is Date().
David-W-Fenton
I assumed that the OP had the correct function, I was just pointing out he was missing the rest of the criteria for BETWEEN....So it would be:AND ((dbo_SDB_APPHISTORY.STARTTIME) Between Date() AND Date() - 180)
Leslie
A: 

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.

Remou