By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,247 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

Dcount - novice user trying to write a novice expression

P: n/a
I admit - I'm a simple user but looking to improve skills.
Instructions aren't helping and have searched this group but am getting
bogged down by some of the programming-speak.

I have a query called PAL_PA Summary and in that query I calculate
several fields, all %s: Fed, ITS, SALT which are 3 of the 6 columns for
example. Basically its a query by person that shows the % of their time
spent in these diff fields (they add up to 100%).

I want to set up a field that counts for each person the # of fields
where the resulting % is equal or greater to 15%. So if person A spent
85% in Fed and 7% in ITS and 8% in SALT, their count would be 1. If
person B spent 85% in Fed and 15% in ITS and 0% in SALT, their count
would be 2.

I already admitted I'm a novice right? I've been trying to do this
from the design view and building an expression but am not sure I'm
understanding "expr" vs "domain" concepts and have seen quotation marks
in some of the google dialogue on other topics and so don't know if I'm
somehow supposed to include those in my expression - I apologize in
advance for this request for hand holding... hopefully someone will
take pity :)

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Gretchen:

One approach would be to use the IIF expression for your count field like
the following:

SELECT TEST2.Field1, TEST2.Field2, TEST2.Field3,
IIf([field1]>=15,1,0)+IIf([field2]>=15,1,0)+IIf([field3]>=15,1,0) AS MyCount
FROM TEST2;

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
<gr*************@ey.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I admit - I'm a simple user but looking to improve skills.
Instructions aren't helping and have searched this group but am getting
bogged down by some of the programming-speak.

I have a query called PAL_PA Summary and in that query I calculate
several fields, all %s: Fed, ITS, SALT which are 3 of the 6 columns for
example. Basically its a query by person that shows the % of their time
spent in these diff fields (they add up to 100%).

I want to set up a field that counts for each person the # of fields
where the resulting % is equal or greater to 15%. So if person A spent
85% in Fed and 7% in ITS and 8% in SALT, their count would be 1. If
person B spent 85% in Fed and 15% in ITS and 0% in SALT, their count
would be 2.

I already admitted I'm a novice right? I've been trying to do this
from the design view and building an expression but am not sure I'm
understanding "expr" vs "domain" concepts and have seen quotation marks
in some of the google dialogue on other topics and so don't know if I'm
somehow supposed to include those in my expression - I apologize in
advance for this request for hand holding... hopefully someone will
take pity :)
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.