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

COUNT within WHERE statement?

Status
Not open for further replies.

3dColor

Programmer
Jan 10, 2006
240
US
Can you place COUNT within a WHERE statement?

My query retreives image names from an Images Table for metro areas within a state.

Code:
SELECT imageState, imageName
FROM Images
WHERE imageState= #URL.state#

I have a checkbox on the page before the query asking them if they want to only include metro areas with photos, if it is checked then then I want to display only the metro areas with photos.

How can I check if a metro area has photos within it?

Code:
SELECT imageState, imageName
FROM Images
WHERE imageState= #URL.state#
      <cfif ISDefined("FORM.photos")>AND image.COUNT > 0</cfif>
 
We'll need more information than that, for example table structures and expected results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top