dbTalk Databases Forums  

DateFirst For Start of Year

microsoft.public.sqlserver.programming microsoft.public.sqlserver.programming


Discuss DateFirst For Start of Year in the microsoft.public.sqlserver.programming forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Matt_The_Beginner
 
Posts: n/a

Default DateFirst For Start of Year - 08-10-2009 , 07:24 PM






Hi All,
By default when you do a datepart(wk,getdate()) it will count the number of
weeks
from the 1st Jan [based on the datefirst parameter]

do you know if it's possible to change the 1st Jan to the 1st July so we can
use the
datepart(wk,getdate()) to count the number of weeks into the fiscal year.

....Cheers

Matt

Reply With Quote
  #2  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: DateFirst For Start of Year - 08-10-2009 , 07:47 PM






How about using a calendar table to indicate the fiscal year?

http://www.aspfaq.com/2519





On 8/10/09 8:24 PM, in article
93FED08B-B61A-4A55-AA5A-0E4FD87B819B...soft (DOT) com, "Matt_The_Beginner"
<Matt_The_Beginner (AT) discussions (DOT) microsoft.com> wrote:

Quote:
Hi All,
By default when you do a datepart(wk,getdate()) it will count the number of
weeks
from the 1st Jan [based on the datefirst parameter]

do you know if it's possible to change the 1st Jan to the 1st July so we can
use the
datepart(wk,getdate()) to count the number of weeks into the fiscal year.

...Cheers


Matt


Reply With Quote
  #3  
Old   
Matt_The_Beginner
 
Posts: n/a

Default Re: DateFirst For Start of Year - 08-10-2009 , 10:18 PM



Hi Aaron,
I think thats a winner

Cheers

Matt


"Aaron Bertrand [SQL Server MVP]" wrote:

Quote:
How about using a calendar table to indicate the fiscal year?

http://www.aspfaq.com/2519





On 8/10/09 8:24 PM, in article
93FED08B-B61A-4A55-AA5A-0E4FD87B819B...soft (DOT) com, "Matt_The_Beginner"
Matt_The_Beginner (AT) discussions (DOT) microsoft.com> wrote:

Hi All,
By default when you do a datepart(wk,getdate()) it will count the number of
weeks
from the 1st Jan [based on the datefirst parameter]

do you know if it's possible to change the 1st Jan to the 1st July so we can
use the
datepart(wk,getdate()) to count the number of weeks into the fiscal year.

...Cheers


Matt




Reply With Quote
  #4  
Old   
Mariano Gomez
 
Posts: n/a

Default Re: DateFirst For Start of Year - 08-11-2009 , 02:28 PM



All ERP systems use a fiscal year table with the at least the beginning date
of each period within the fiscal year.

Best regards,
--
MG.-
Mariano Gomez, MIS, MCP, PMP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com
The Dynamics GP Blogster at http://dynamicsgpblogster.blogspot.com


"Aaron Bertrand [SQL Server MVP]" wrote:

Quote:
How about using a calendar table to indicate the fiscal year?

http://www.aspfaq.com/2519





On 8/10/09 8:24 PM, in article
93FED08B-B61A-4A55-AA5A-0E4FD87B819B...soft (DOT) com, "Matt_The_Beginner"
Matt_The_Beginner (AT) discussions (DOT) microsoft.com> wrote:

Hi All,
By default when you do a datepart(wk,getdate()) it will count the number of
weeks
from the 1st Jan [based on the datefirst parameter]

do you know if it's possible to change the 1st Jan to the 1st July so we can
use the
datepart(wk,getdate()) to count the number of weeks into the fiscal year.

...Cheers


Matt




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.