Print Page | Close Window

Retrieving Two Different Values

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=16172
Printed Date: 29 March 2026 at 5:00pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Retrieving Two Different Values
Posted By: Misty
Subject: Retrieving Two Different Values
Date Posted: 10 August 2005 at 3:45pm
I'd like to retrieve records for both states: GA and NC from a database.
 
Here's my SQL Query: select clientname, businessname, city, state from Clients where state = 'ga' and state = 'nc'
 
This didn't return any records even though I got no error message. These records do exist. Can someone please help me to fix this SQL Query?
 



Replies:
Posted By: dpyers
Date Posted: 10 August 2005 at 4:28pm
Don't think a stade can be equal  ga AND equal nc at the same time, but it could be = ga OR nc. Wink

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: dj air
Date Posted: 10 August 2005 at 4:31pm
that brings me back memories,

i was at college once, and the tutors where haviong problems with access.

couldn't get records with xx or yy or dd

turns out they where using and instead of OR

they where in thoury using


get all records where field = xx and field = yy and field = dd

they couldn't wok it out , that it had to be ORLOL



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net