Help with Count function

lsteffen

New member
Local time
Today, 14:24
Joined
Sep 6, 2007
Messages
9
Hi all,

I have a database where we schedule work and have the corresponding work order or preventative maintenance number in a field called [WO/PM #]. I am trying to make a field that will basically find the records for the certain day and if the work is scheduled and the [WO/PM #] field begins with "WO*", then I need a count of all work orders scheduled for that day. Here is my syntax that is returning a value of 0.

=IIf([Scheduled]=Yes & [WO/PM #]="WO*",DCount("WO*","[WO/PM #]"),0)

Can someone assis?

Thank you,
Liz

:confused:
 
I did use AND rather than &, but that did not help either.
 
Do you have a paired down version of the database you can attach to this site? It'd be easier if I could look at the database.
 
I could be wrong, but i think that if [WO/PM #] is a text field you need to wrap WO* in single quotes so that access knows its text.

something like this...

[WO/PM #] = '" & WO* & "'"

also be sure to use AND as CPREMO suggested
 
I must be missing the point here as i don't see a datefield, however isn't it simple to do this in the query that the report is based on
criteria of scheduled "yes" total line Where
criteria of[WO/PM #] Like "WO*" total line Where
countscheduled Count(*) total line Expression

Brian
 

Users who are viewing this thread

Back
Top Bottom