Report Textbox Expression error

HI

Where am I going wrong with this expression.  It's returning all Invoice values.  If I drop the last part  And "[id]=19 it returns the correct value.

=Nz(DSum("Invoice","PurchaseOrders","[ordertype]='opex'" And "[id]=19"),0)

Thanks
Robert SchumannFacilities PlannerAsked:
Who is Participating?
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.

Gustav BrockCIOCommented:
Try with:

=Nz(DSum("Invoice","PurchaseOrders","[ordertype]='opex' And [id]=19"),0)

Open in new window

0
Robert SchumannFacilities PlannerAuthor Commented:
Great, it's working.  Thanks

Now, I need to add another criteria.  Tried this, but it returns "$0.00"  Thought I could just add an addition "AND".

=Nz(DSum("Invoice","PurchaseOrders","[ordertype]='opex' And [id]=19 And [id]=17"),0)
0
Gustav BrockCIOCommented:
Id cannot be both 17 and 19.
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!

John TsioumprisSoftware & Systems EngineerCommented:
ANd ID IN (17,19)
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
Robert SchumannFacilities PlannerAuthor Commented:
Thank you all.  Great help!!
0
Gustav BrockCIOCommented:
It was a pleasure to supply the answer to your initial question.

I'm sorry I didn't guess, that what you next meant was:

=Nz(DSum("Invoice","PurchaseOrders","[ordertype]='opex' And ([id]=19 Or [id]=17)"),0) 

Open in new window

0
Robert SchumannFacilities PlannerAuthor Commented:
Thank you both.  They were both great answers!!
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.