Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compex update query with two conditions? 1

Status
Not open for further replies.
Feb 12, 2003
45
US
Here's my code:

UPDATE pTquick SET pTquick.openpcount=DCOUNT("*", "pRquick", "unitnum=" & pTquick.unitnum & " AND isnull(pRquick.exporteddate)");

I'm trying to count the sum of process matching accountnums (unitnum) and only those processes that have a date of export.
Is this a syntax issue here? Or anyone have a better method?
Thanks much,
Chris

BTW - Access runs this query by give a 'cannot execute query because of a type conversion failure (openpcount is defined as an integer).
 
If unitnum is not defined as numeric in pRquick:
UPDATE pTquick SET pTquick.openpcount=DCOUNT("*", "pRquick", "unitnum='" & pTquick.unitnum & "' AND exporteddate Is Null");

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Dude, you have now idea how POWERFUL this is!!!! THANK YOU!
Wow... very cool!
YEEESS!!!
At first I thought the dcount was returning something that was incompatible with the count'd value (like instead of a zero a null, or somesuch) but, as usual, it make perfect sense!
Thanks!
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top