I am having difficulty adding the dateadd function to a sql script "where" clause within an application. I want to include records that have neg qty within a 20day period.
The original code is:
sql = "Delete * From tblSales where date_shipped >= #" & LastUpdate & "#" & _
I added the following:
"or tblSales.qty_shipped < 0 and tblSales.date_shipped >= dateadd(dd,-20,# LastUpdate #)
DoCmd.RunSQL (sql)
Though I could do this easily in T-SQL I'm running into a fence trying to do this within Access.
The original code is:
sql = "Delete * From tblSales where date_shipped >= #" & LastUpdate & "#" & _
I added the following:
"or tblSales.qty_shipped < 0 and tblSales.date_shipped >= dateadd(dd,-20,# LastUpdate #)
DoCmd.RunSQL (sql)
Though I could do this easily in T-SQL I'm running into a fence trying to do this within Access.