Click here to Skip to main content
15,885,925 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends,

I have a table names msg_scheduler. In which I am keeping scheduleInterval column value in numeric(1/2/3/4 for onetime/daily/weekly/monthly respectively).

I have another column schedule_days in which I keep day of week in comma-separated value (1,3)[mon/wed - i am setting mon as my first day of week) .

Now I have to get the records in daily basis it is scheduled in.

suppose i have 3 messages scheduled.
Like: -
1) one time msg scheduled for Mon-10 march 5pm
2) daily msg scheduled for 5pm
3) weekly msg scheduled for Mon/Wed 5pm
3) monthly msg scheduled for every month 10th day 5pm

How can I write the sql query to fetch the records which meets all the above criteria in one statement.


Thanks in advance...
Posted

1 solution

I have solved my issue with Case Statement inside Where clause.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900