Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Pass in Year and Quarter and get the fiscal start and end dates

By Sriman Bapatla,

Pass Year and Quarter and get the Fiscal StartDate and Endate.


Example:

For 2010-Q1

select [dbo].[GetQuarterStartDate] ('2010-Q1')
select [dbo].[GetQuarterEndDate] ('2010-Q1')


will yield the following results


2009-10-01
2009-12-31

Total article views: 1027 | Views in the last 30 days: 3
 
Related Articles
FORUM

Tablix compute pct chg from previous year quarter

Am having a problem in Visual Studio 2008 R2 tablix computing [u]percent change from same quarter la...

Tags
date manipulation    
t-sql    
 
Contribute