Solved

tsql select field contain like MO TU WE TH

Posted on 2012-12-25
1
444 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 70

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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