Where clause in query

I have a query need the following 3 criteria: the Finished must be "No". Of the ones with a Finished = No, two things can happen... either there is a value entered in CallBackDate OR WorthCallBack is Yes.

Finished = No (everyone must have this)
With the ones that have Finished = No then: CallBackDate = [a value entered] OR WorthCallBack = Yes

Thanks!
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.

omgangIT ManagerCommented:
WHERE (((Finished)="No") AND (Not (CallBackDate) Is Null)) OR (((Finished)="No") AND ((WorthCallBack)="Yes"));

OM Gang
0
cansevinAuthor Commented:
Thanks OM, it currently is saying there is a Syntax Error (mission operation) in the query expression

Then lists the Where and the Group By

I also need one more parameter... only for data with DateCalled between 1/1/2015 and 12/31/2015.

Thanks for your help.
0
omgangIT ManagerCommented:
Please post up the current SQL statement.
OM Gang
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

cansevinAuthor Commented:
SELECT [Memo List Table].MemoNumber, [Memo List Table].DateCalled, [Memo List Table].MemoEmail, [Memo List Table].TypeOfClient, [Memo List Table].NewClientType, [Memo List Table].CallBackDate, [Memo List Table].Memo, ReachOutSales.MemoNum
FROM [Memo List Table] INNER JOIN ReachOutSales ON [Memo List Table].MemoNumber = ReachOutSales.MemoNum
WHERE (((Finished)="No") AND ((Not (CallBackDate)Is Null)) OR (((Finished)="No") AND ((WorthCallBack)="Yes"))
GROUP BY [Memo List Table].MemoNumber, [Memo List Table].DateCalled, [Memo List Table].MemoEmail, [Memo List Table].TypeOfClient, [Memo List Table].NewClientType, [Memo List Table].CallBackDate, [Memo List Table].Memo, ReachOutSales.MemoNum;

Open in new window

0
omgangIT ManagerCommented:
I had one too many left parentheses in the WHERE clause.  Try this

SELECT [Memo List Table].MemoNumber, [Memo List Table].DateCalled, [Memo List Table].MemoEmail, [Memo List Table].TypeOfClient, [Memo List Table].NewClientType, [Memo List Table].CallBackDate, [Memo List Table].Memo, ReachOutSales.MemoNum
FROM [Memo List Table] INNER JOIN ReachOutSales ON [Memo List Table].MemoNumber = ReachOutSales.MemoNum
WHERE (((Finished)="No") AND (Not (CallBackDate)Is Null) AND ((DateCalled) Between #1/1/2015# And #12/31/2015#)) OR (((Finished)="No") AND ((DateCalled) Between #1/1/2015# And #12/31/2015#) AND ((WorthCallBack)="Yes"))
GROUP BY [Memo List Table].MemoNumber, [Memo List Table].DateCalled, [Memo List Table].MemoEmail, [Memo List Table].TypeOfClient, [Memo List Table].NewClientType, [Memo List Table].CallBackDate, [Memo List Table].Memo, ReachOutSales.MemoNum;

Open in new window

0

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
cansevinAuthor Commented:
Ok... now it says "DataType mismatch" I'll open another question... that usually is different issue. Thanks!
0
omgangIT ManagerCommented:
Data Type mismatch.  Is the Finished Field Boolean (Yes/No)?  Or the WorthCall field, is it Boolean (Yes/No)?  In your Q, you had wrapped "No" in quotes so I proceeded as if it was a text field.  If it's a Boolean field then you simply changed the WHERE clause like this

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

Open in new window

0
cansevinAuthor Commented:
Genius... thanks. If you want, post that answer to my new questions. I already closed this one before it was submitted. I appreciate your help on this!
0
omgangIT ManagerCommented:
You can close that Q; I feel it was all part of the same solution on my part.  Thanks though.
OM Gang
0
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.