-
Help
Hey I'm having trouble with a query. I have fields Date_Recieved, and Date_Mailed. I want to run a query to show the customers who havent returned their surveys within 30 days. Also I have customers who don't have anything in the Date_Received field yet. I wrote this code but it doesn't work
SELECT *
FROM Customer
WHERE [Date Received] is NULL AND [Date Mailed] > (Date() - 30);
It just shows the null values in the field. Not the other ones where I have recieved the surveys that are 30 days or older.
Also I tried
Select * from Customer
Where [Date Received] is NULL
And [Date Received] - [Date Mailed] >30;
And it comes up with nothing
-
Try adding # around the dates.
SELECT *
FROM Customer
WHERE #[Date Received]# is NULL AND #[Date Mailed]# > (Date() - 30);
Dale
FYI, Remove all spaces from your field names.
Makes you database developing life a lot easier.
-
It says syntax error in date in query expression
-
Nevermind I figured it out. I used OR instead of AND
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules