SELECT Count / Sum

  • Thread starter Thread starter lmossolle
  • Start date Start date
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
 
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 <--
 
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 <--
 
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 <--
 
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
 
Back
Top