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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can anyone tell me what is wrong wi 2

Status
Not open for further replies.

tqd123

MIS
May 11, 2006
8
US
Can anyone tell me what is wrong with this statement? I kept getting TYPE MISMATCH error.

TotalQty = (DSum("[QtyOrdered]", "Load Query", "[ProductCode] = '" & TPC & "'" And "[CDueDate] = #" & PCDate & "#"))

If I put the criterias seperately then the statement works, but if I use the AND to use the criterias together, then I get the TYPE MISMATCH.

Thanks,

TD
 
TD
I think the problem lies in the Where clause...
"[ProductCode] = '" & TPC & "'" And "[CDueDate] = #" & PCDate & "#"))

Try removing the quote mark (") before [CDueDate]

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top