May 27, 2015 at 5:03 am
UPDATE Report
SET MSYear= casewhen MSDate > '2011/06/30' and MSDate < '2012/07/01' THEN '2012'
when MSDate > '2012/06/30' and MSDate < '2013/07/01' THEN '2013'
when MSDate > '2013/06/30' and MSDate < '2014/07/01' THEN '2014'
when MSDate > '2014/06/30' and MSDate < '2015/07/01' THEN '2015'
when MSDate > '2015/06/30' and MSDate < '2016/07/01' THEN '2016'
when MSDate > '2016/06/30' and MSDate < '2017/07/01' THEN '2017'
End
Actually our business year starts from 1st july and for this code I need function which is dynamically updates the every year
for example 2014-07-01 to 2015-06-30 this is called as a 2015 year like this I need function which will dynamically update a year
May 27, 2015 at 5:12 am
This seems fairly similar to your previous question (Possibly even identical!), are you not able to use the method suggested by Chris? If you need further explanation, perhaps better to continue on the original post.
http://www.sqlservercentral.com/Forums/Topic1685872-392-1.aspx
May 27, 2015 at 5:57 am
Dohsan (5/27/2015)
This seems fairly similar to your previous question (Possibly even identical!), are you not able to use the method suggested by Chris? If you need further explanation, perhaps better to continue on the original post.http://www.sqlservercentral.com/Forums/Topic1685872-392-1.aspx
Good catch, Dohsan. I'll post a function that might help on the original thread.
May 27, 2015 at 6:06 am
Ed Wagner (5/27/2015)
Dohsan (5/27/2015)
This seems fairly similar to your previous question (Possibly even identical!), are you not able to use the method suggested by Chris? If you need further explanation, perhaps better to continue on the original post.http://www.sqlservercentral.com/Forums/Topic1685872-392-1.aspx
Good catch, Dohsan. I'll post a function that might help on the original thread.
I only remembered it because of the simplicity of Chris's answer! One of those you remember if a similar scenario ever pops up.
May 27, 2015 at 6:14 am
Dohsan (5/27/2015)
Ed Wagner (5/27/2015)
Dohsan (5/27/2015)
This seems fairly similar to your previous question (Possibly even identical!), are you not able to use the method suggested by Chris? If you need further explanation, perhaps better to continue on the original post.http://www.sqlservercentral.com/Forums/Topic1685872-392-1.aspx
Good catch, Dohsan. I'll post a function that might help on the original thread.
I only remembered it because of the simplicity of Chris's answer! One of those you remember if a similar scenario ever pops up.
Yeah, I know exactly what you mean. I've struggled with puzzles before and then suddenly see some blinding flash of the obvious in math that makes it so simple I feel out-to-lunch for not seeing it before.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply