date messes it all up

Pharcyde

Arriba Arriba!!!
Local time
Today, 18:58
Joined
Sep 4, 2003
Messages
116
Hi there. I'm doing a report for university stats.

So I'm using alot of DCount in the textfields. It was all going smoothlly until i had an error whilst using the following:

=DCount("[StatusCode]","stu-stats","[MOQInstituteName] = 'Cardiff' AND [StatusCode] ='R ' AND [MOQType] ='Law Degree' AND [MOQGrade] = '1' AND [MOQYear] = '2002' ")

But i dont undestand why it doesnt work, when the following one does:

=DCount("[StatusCode]","stu-stats","[MOQInstituteName] = 'Cardiff' AND [StatusCode] ='R ' AND [MOQType] ='Law Degree' AND [MOQGrade] = '1' ")

-so the only difference is the AND [MOQYear]='2002'

Can anyone see where I'm going wrong here? Thanks loads, Lee
 
Rich said:
Is MOQYear a date or text field?

Or a numeric?
 
ah, its numeric, as in 2002, 1999, etc etc...
 
Then take the apostrophes that surround it out.


i.e.

= 2002


and not

= '2002'



SAme goes for that other field if it's numeric and not '1'
 

Users who are viewing this thread

Back
Top Bottom