Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 15th, 2004, 01:42 PM
mayde78 mayde78 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 83 mayde78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 23 m 54 sec
Reputation Power: 5
SQL Query

I have a column for availability in the Options table.

This column contains 2 records

1st record: "Monday, Tuesday, morning"
2nd record: "Monday, evening".

How do i write a query that returns"

1st record: if "avail = morning"
both records: if "avail = monday"
both records: if "avail = monday, morning"

Reply With Quote
  #2  
Old November 15th, 2004, 03:18 PM
Scorpions4ever Scorpions4ever is offline
Mad Rater
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 126 Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 31 m 44 sec
Reputation Power: 8
You could use the LIKE statement perhaps?

SELECT * FROM TABLE
WHERE column LIKE '%morning%'

SELECT * FROM TABLE
WHERE column LIKE '%monday%'

SELECT * FROM TABLE
WHERE column LIKE '%monday%'
OR column LIKE '%morning%'
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > SQL Query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT