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

One more Syntax Question 1

Status
Not open for further replies.

Moose222

Technical User
Oct 18, 2001
13
US
I am trying to put an equation in the report section where:

In one column [GCFLAG] there are G's and C's.
In another column [ORDER] there are various items.


I need to count the # of G's in [GCFLAG] and then compare the [ORDER] where ORDER is not equal to ' ' or spaces.

In DB3 code the not equal to sign was programmed as the #.

So far here is what I have tried, but it dosen't see to work:

=DCount("[GCFLAG]", "NASTAT", "='G' And [ORDER] Not =" ")

I usually get errors.

Any help you can give would be appreciated.

Thanks,
Jim Nelson
 
Try:
Code:
=DCount(&quot;[GCFLAG]&quot;, &quot;NASTAT&quot;, &quot;[GCFLAG] = 'G' And [ORDER] <> ' '&quot;)
 
Once again OUTSTANDING!!!!!

I sort of have one other question, it seems that when the math is complete I have one extra on the answer. For instance the formula should return a 2 and is returning a 3.

Is that from using DCount?

Thanks again if you were in CA I'd buy you a beer.

Jim
 
Jim, This might occur because a null may be stored in ORDER instead of a &quot; &quot; (space). See if this makes a difference:
Code:
=DCount(&quot;[GCFLAG]&quot;, &quot;NASTAT&quot;, &quot;([GCFLAG] = 'G') And (([ORDER] <> ' ') And ([ORDER] is not null))&quot;)

And if I was in CA I'd take you up on that beer.......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top