Solved

tsql select field contain like MO TU WE TH

Posted on 2012-12-25
1
436 Views
Last Modified: 2012-12-25
I HAVE A FIELD NAME recurencerule

DTSTART:20110903T150000Z  DTEND:20110903T160000Z  RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO;WKST=SA  
DTSTART:20120505T140000Z  DTEND:20120505T160000Z  RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,WE,SA,SU;WKST=SA  
DTSTART:20120907T140000Z  DTEND:20120907T160000Z  RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=FR;WKST=SA  
DTSTART:20121129T150000Z  DTEND:20121129T160000Z  RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TH;WKST=SA  


i want to search for the variable like TU or WE MO FR SA SU IN THE LAST OF THIS STRING..

FROM BYDAY=TU,WE,SA,SU;  

BYDAY= xx,XX,XX,XX ;
SEARCH INSIDE THIS ONLY ?
0
Comment
Question by:afifosh
1 Comment
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
ID: 38719968
It's not completely clear. Do you want to see if a specific weekday is in the BYDAY list? In that case:
declare @ThisDay char(2)
set @ThisDay='TU'

select * from tbl where recurencerule like '%;BYDAY=%'+@ThisDay+';WKST=%'

Open in new window

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now