geroido Posted August 30, 2008 Share Posted August 30, 2008 Hi Can you see where the problem is with this query. It seems straightforward but is not working. There are no records in my database for the county 'Enniskillen' but it is retrieving all records where servType = 'Delivery only'. So it is getting records from the other counties who match Delivery only. I expect it to first look to see if Enniskillen exists, then if it does check that registered = 'yes', then give me all of those restaurants whose ServType = 'Delivery and restaurant booking' and servtype = 'Delivery only'. select clientID, busname, strAddr1, strAddr2, towncity, county, servType, registered FROM clientdetails where towncity = 'Enniskillen' and registered = 'yes' and servType = 'Delivery and restaurant booking' and servtype = 'Delivery only' Quote Link to comment Share on other sites More sharing options...
fenway Posted August 30, 2008 Share Posted August 30, 2008 Please indicate how this was "solved" before marking it such. Quote Link to comment Share on other sites More sharing options...
geroido Posted August 30, 2008 Author Share Posted August 30, 2008 Having was the important bit left out instead of AND HAVING servType = 'Delivery and restaurant booking' and servtype = 'Delivery only' Quote Link to comment Share on other sites More sharing options...
fenway Posted August 30, 2008 Share Posted August 30, 2008 Not sure how that would have solved it.... but servtype can't be equal to 2 things at once! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.