SELECT Count / Sum

L

lmossolle

I need assistance with the following;

SELECT COUNT(*) As NumRecords
FROM [KT Number]
WHERE [KT Value] >100000 And <1000000

SELECT SUM(*) As $Value
FROM [KT Number]
WHERE [KT Value] >100000 And <1000000
Group by [Effective FY] and [Effective FY QTR]

Thanks
 
S

Stefan Hoffmann

hi,
I need assistance with the following;
Simple Jet SQL, take a look at the OH.

SELECT COUNT(*) As NumRecords
FROM [KT Number]
WHERE [KT Value] >100000 And <1000000
Either

WHERE [KT Value] BETWEEN 100000 AND 1000000

or

WHERE [KT Value] >= 100000
AND [KT Value] <= 1000000
SELECT SUM(*) As $Value
SELECT SUM([yourFieldNameHere]) AS [$Value]
FROM [KT Number]
WHERE [KT Value] >100000 And <1000000
Group by [Effective FY] and [Effective FY QTR]

GROUP BY [Effective FY], [Effective FY QTR]


mfG
--> stefan <--
 
L

lmossolle

This is what i gathered from you;

SELECT SUM([KT Value]) AS [$Value]
WHERE [KT Value] BETWEEN 100000 AND 1000000
GROUP BY [Effective FY], [Effective FY QTR];

I am getting the following error;

The select statement includes a reversed word or an arguement name that is
misspelled or missing, or the punctuation is incorrect.

Thanks

Stefan Hoffmann said:
hi,
I need assistance with the following;
Simple Jet SQL, take a look at the OH.

SELECT COUNT(*) As NumRecords
FROM [KT Number]
WHERE [KT Value] >100000 And <1000000
Either

WHERE [KT Value] BETWEEN 100000 AND 1000000

or

WHERE [KT Value] >= 100000
AND [KT Value] <= 1000000
SELECT SUM(*) As $Value
SELECT SUM([yourFieldNameHere]) AS [$Value]
FROM [KT Number]
WHERE [KT Value] >100000 And <1000000
Group by [Effective FY] and [Effective FY QTR]

GROUP BY [Effective FY], [Effective FY QTR]


mfG
--> stefan <--
 
S

Stefan Hoffmann

lmossolle said:
This is what i gathered from you;

SELECT SUM([KT Value]) AS [$Value]
WHERE [KT Value] BETWEEN 100000 AND 1000000
GROUP BY [Effective FY], [Effective FY QTR];

I am getting the following error;

The select statement includes a reversed word or an arguement name that is
misspelled or missing, or the punctuation is incorrect.
Obviously there is the FROM line missing. Otherwise check the spelling
of the field names.


mfG
--> stefan <--
 
J

John Spencer

What is the problem? Both those queries should execute.

Do you want to get the results of both queries in one query?

Do you want to see Effective Fy and Effective FY Qtr?

Are you getting an error message?
Are you getting the wrong results? If so, how are they wrong?

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top