Where clause

I am using the below query. The problem is when I added the CallBackDate <=Date() it only brings up the values that have a call back date. I need this to be

"If there is a callbackdate, then only the ones today or prior. If there is not a callback date, then don't worry about it"

SELECT [Memo List Table].MemoNumber, [Memo List Table].DateCalled, [Memo List Table].MemoEmail, [Memo List Table].TypeOfClient, [Memo List Table].Area, [Memo List Table].NewClientType, [Memo List Table].TalkedFirst, [Memo List Table].CallBackDate, [Memo List Table].Memo, Count(ReachOutSales.MemoNum) AS CountOfMemoNum
FROM [Memo List Table] LEFT JOIN ReachOutSales ON [Memo List Table].MemoNumber = ReachOutSales.MemoNum
WHERE ((([Memo List Table].Finished)=False) AND (Not ([Memo List Table].CallBackDate) Is Null) AND (([Memo List Table].DateCalled) Between #1/1/2015# And #12/31/2015#) AND (([Memo List Table].CallBackDate)<=Date())) OR ((([Memo List Table].Finished)=False) AND (([Memo List Table].DateCalled) Between #1/1/2015# And #12/31/2015#) AND (([Memo List Table].WorthCallBack)=True) AND (([Memo List Table].CallBackDate)<=Date()))
GROUP BY [Memo List Table].MemoNumber, [Memo List Table].DateCalled, [Memo List Table].MemoEmail, [Memo List Table].TypeOfClient, [Memo List Table].Area, [Memo List Table].NewClientType, [Memo List Table].TalkedFirst, [Memo List Table].CallBackDate, [Memo List Table].Memo;

Open in new window

cansevinAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PatHartmanCommented:
Please stick to one thread for a topic.  You can ask follow-on questions if necessary.

By "don't worry about it", I assume you mean that you want records with a callback date <= today or with an empty callback date.


CallBackDate <=Date()  OR CallBackDate Is Null
Gustav BrockCIOCommented:
You can use:

    Nz([CallBackDate],Date()) <=Date()

/gustav

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.