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

UNION Query Wants Parameter Value Entered?

Status
Not open for further replies.

sharkchaser

Technical User
Mar 19, 2010
50
US
This is what I have. . .

It keeps asking me to enter an 'Active' parameter value?

Code:
SELECT COUNT(*) AS [Count <=199999]
  FROM tblCARETSData
 WHERE ListingStatus = ‘Active’
   AND ListPrice <= 199999
   AND County = 'orange'

UNION ALL

SELECT COUNT(*) AS [Count >=200000 <=299999]
  FROM tblCARETSData
 WHERE ListingStatus = ‘Active’ 
   AND ListPrice >=200000
   AND ListPrice <=299999
   AND County = 'orange';

Any suggestions would be greatly appreciated.

Thanks . . . Rick
 
Hi Rick,

You need to revise both of your 'Where' Statements

ie:
WHERE
( ((tblCARETSData.ListingStatus) = 'Active') AND
((tblCARETSData.ListPrice) <= 199999) AND
((tblCARETSData.County) = 'orange') )

Make the same type of change to the both where statements in the union query.

Hope this helps,
Hap...

Access Developer [pc] Access based Accounting Solutions - with free source code
Access Consultants forum
 

Code:
SELECT
  COUNT(*) [b]AS Cnt
, 'Count <=199999' AS 'Range'[/b]
  FROM tblCARETSData
 WHERE ListingStatus = 'Active'
   AND ListPrice <= 199999
   AND County = 'orange'

UNION ALL

SELECT 
  COUNT(*)[b]
, 'Count >=200000 <=299999'[/b]
  FROM tblCARETSData
 WHERE ListingStatus = 'Active' 
   AND ListPrice >=200000
   AND ListPrice <=299999
   AND County = 'orange';

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top