Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Query Help

$
0
0
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

Viewing all articles
Browse latest Browse all 13329

Trending Articles