Dsum function

J

Jedit

My problem is that i need to use wild cards with Dsum

DSum("[Unit Cost]","QRY_Part_No_OPs","[mc]='M*'")

where I want to sum on everything begining with M, i THAUGHT i COULD JUST
DROP IN * BUT THIS RETURNS NO DATA?

eg
MILL
MILLC
MTURNC
MTURN
MGENERAL
MSUBCO

Help please
 
K

Ken Snell [MVP]

You must use the Like operator in order to use a wildcard:

DSum("[Unit Cost]","QRY_Part_No_OPs","[mc] Like 'M*'")
 
S

Steve Schapel

Jedit,

I agree 100% with Ken.

Another way to do it...
DSum("[Unit Cost]","QRY_Part_No_OPs","Left([mc],1)='M'")
 
Top