June 20, 2012 at 5:42 am
guys i want to show 01/05/2011 lies in 1 quarter
how i do that.
June 20, 2012 at 5:54 am
SELECT DATEPART (quarter , '01/05/2011' )
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537June 20, 2012 at 5:58 am
my friend i want to show any date lies between date 01/04/2011 to 30/06/2011 under in 1 quarter
June 20, 2012 at 6:07 am
Search for "Calendar Table", you may want something like this
SELECT dt,
DATEPART(quarter,dt)
FROM Calendar
WHERE dt BETWEEN '01/04/2011' AND '30/06/2011'
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537June 20, 2012 at 6:11 am
but 10/08/2011 not show in 2 quarter
June 20, 2012 at 6:16 am
shubhamagrawal.107 (6/20/2012)
but 10/08/2011 not show in 2 quarter
That's because it's in quarter 3
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply