Robert Schumann
asked on
Date Validation in a Report
Hi, where am I going wrong with this expression. It's in a report text field. The table field "creationdat" is formatted for Date/Time. The expression is not pulling data created after 10/01/2018. It should pull all data entered after 10/01/2018. But it's pulling all data.
=Nz(DSum("amount","Purchas eOrders"," [creationd at]>=#10/0 1/2018# Or [id]=39"),0)
=Nz(DSum("amount","Purchas
ASKER
Hi - get an "Invalid syntax"
ASKER
Sorry, The error is " The expression you entered has a function containing the wrong number of arguments.
Your expression seems correct, but shouldn't it be for one ID only, thus And:
=Nz(DSum("amount","PurchaseOrders","[creationdat]>=#10/01/2018# And [id]=39"),0)
i forgot a parenthesis
=Nz(DSum("amount","PurchaseOrders","[creationdat]>=#" & Format("10/01/2018","mm/dd/yyyy") & "# Or [id]=39"),0)
ASKER
That's what I thought, and I added it, but it still returns all the data for "Amount". Does not filter out all data before 10/01/2018.
"[creationdat]>=#10/01/2018#"
will sort anything out before that date.So look at the other part of the criteria.
ASKER
Each record has an ID field. This expression will return all values, it is not filtering for records with an ID 39. Other expressions in the report will return the correct value. It's just not working when adding the date.
=Nz(DSum("amount","Purchas eOrders"," [creationd at]>=#" & Format("09/30/2018","mm/dd /yyyy") & "#or [id]=39 "),0)
If I delete the ID reference it will return the correct value, those with a date after 10/01/2018. But confused. It should work, but doesn't.
=Nz(DSum("amount","Purchas eOrders"," [creationd at]>=#" & Format("09/30/2018","mm/dd /yyyy") & "#"),0)
=Nz(DSum("amount","Purchas
If I delete the ID reference it will return the correct value, those with a date after 10/01/2018. But confused. It should work, but doesn't.
=Nz(DSum("amount","Purchas
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The AND did it!!
=Nz(DSum("amount","Purchas eOrders"," [creationd at]>=#" & Format("09/30/2018","mm/dd /yyyy") & "#And [id]=39 "),0)
Thank you both.
=Nz(DSum("amount","Purchas
Thank you both.
You are welcome!
Open in new window