I’m trying to use the below code to bring back all records that are not older than 90 days from a table:
Set PlatinumList = db.OpenRecordset( _
"SELECT FORMATTED_CTN FROM CTN_LIST " _
& "WHERE ((Status='Available') AND (Category='Platinum')) " _
& "AND (In_Offer_List = True) " _
& "AND (DATEDIFF(day, Created_DT, current_date()< 90);", _
dbOpenSnapshot, dbReadOnly)
I keep getting a syntax error in query expression error when I try and run the code.
I think I’m formatting the date section of the code incorrectly.
The date token for day is
"d"rather thandayand your missing a closing)(You also need current_date() as a vba func)