March 6, 2014 at 3:12 am
I need help over this thing. I am working on a table which looks like
Date Dateofyear
2014-01-01 1
2014-01-02 2
2014-01-03 3
2014-01-04 4
2014-01-05 5
. .
..
..
2014-12-31 365
Now i need to Run a query on this table to show me result after taking input from user (store proc ) if user enters 2 then
StartDate EndDate
2014/01/01 2014/07/01
2014-07-02 2014-12-31
and if user enter 5 then
StartDate EndDate
2014/01/01 2014-03-14
2014-03-15 2014-05-26
2014-05-27 2014-08-07
2014-08-08 2014-10-19
2014-10-19 2014-12-31
I hope I made it clear; kindly Help me over this.
Alot of thanks in Advance ;
please
March 6, 2014 at 4:27 am
Please do not crosspost. It wastes peoples time and fragments replies.
Original thread with replies can be found here:
http://www.sqlservercentral.com/Forums/Topic1548128-8-1.aspx
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
March 6, 2014 at 4:54 am
hy there, I got looped on submit button.
and could not find any option to delete my post.
Sorry if this bothered you
March 6, 2014 at 4:56 am
AdityaSingh (3/6/2014)
hy there, I got looped on submit button.and could not find any option to delete my post.
Sorry if this bothered you
It didn't bother me.
It could bother me if I would have taken some of my time to write you a query only to find out someone already did that on your other thread a few days ago. Luckily I was first 😀
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply