Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Script Library
 Week numbers based on physical year

Author  Topic 

kishoremcp
Starting Member

41 Posts

Posted - 2013-10-25 : 07:18:43
Hi,

my physical year starts in June. So, June 1st week is week 1 for me. Like that if i give a date then it should give me the week number according to my phisical year. how to get it in sql query?

Regards
Kishore

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-25 : 08:39:57
You mean Fiscal year rite?
Best thing is to populate calendar table with all your dates and then apply week value sequentially as 1,2 etc from June 1 onwards with corresponding fiscal year value

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

kishoremcp
Starting Member

41 Posts

Posted - 2013-10-25 : 09:00:08
Yes.

Regards
Kishore
Go to Top of Page

kishoremcp
Starting Member

41 Posts

Posted - 2013-10-25 : 09:56:24
Is it not possible using a query dynamically?

Regards
Kishore
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-10-25 : 10:40:05
quote:
Originally posted by kishoremcp

Is it not possible using a query dynamically?

Regards
Kishore


does it always coincide with actual month start and end?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

kishoremcp
Starting Member

41 Posts

Posted - 2013-10-25 : 10:48:14
Yes. You are correct..

Regards
Kishore
Go to Top of Page
   

- Advertisement -