DCOUNT or SUM?

eepok

Noob. Well, mostly noob.
Local time
Yesterday, 23:53
Joined
Oct 30, 2007
Messages
112
Hi again,

I'm having a bit of trouble with these two concepts and am hoping someone could shed some light how I could use one or the other to get what I need:

Have I have:
FieldA, FieldB, FieldC, FieldD

I need to count up all the fields that have "X" as a value in all those fields combined.

Thank you in advance for helping me when I can no longer think properly for myself. ;)
 
Last edited:
SELECT (FieldA + FieldB + FieldC) FROM ....
 
SELECT (FieldA + FieldB + FieldC) FROM ....

I know I should probably know how to put that to use, but would you be willing to put that in an expression? I am still rather nooberly to SQL. (I'll pick it up some day... promise!)
 
In query design view, click View -> SQL View.

You should see the SELECT, then you can type in the fieldname in the () like above. Switch back to design view then you'll see how it works. :)
 
Query Problem - Count of X

Try this with two Queries:

1. SELECT InStr(1,[A] & & [C] & [D],"X") AS NewField
FROM Table3;

Query Name: Query11

If the Character X is appearing in any of the Four Fields Joined then the NewField will have the value > 0 in all the records other-wise it will have Zeros.

2. Create another Query using the above one as input and take the count where NewField Value is more than 0 cases.

SELECT Count(Query11.NEWFIELD) AS CountOfNEWFIELD
FROM Query11
WHERE (((Query11.NEWFIELD)>0));

http://www.msaccesstips.com
 

Users who are viewing this thread

Back
Top Bottom