Solved

Query - Fiscal Year July 1 - June 30 from Claim Date

Posted on 2014-12-09
4
146 Views
Last Modified: 2014-12-09
I have a ClaimDate and I want to identify the FY.  The FY in my company if from July 1st through June 30.

I want the just the FY (i.e. 2014) to display as a result.

Thank you!
Scott
0
Comment
Question by:Scott Williams
  • 2
4 Comments
 
LVL 48

Expert Comment

by:PortletPaul
ID: 40489969
What is the database type? (date functions differ between database vendors)
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 400 total points
ID: 40489972
datepart(year,ClaimDate) + case when datepart(month,ClaimDate) < 7 then -1 else 0 end
0
 

Author Comment

by:Scott Williams
ID: 40489973
SQL Server 2012
0
 
LVL 48

Assisted Solution

by:PortletPaul
PortletPaul earned 100 total points
ID: 40489975
try this perhaps:

case when month(ClaimDate) >= 7 then year(ClaimDate) else year(ClaimDate) - 1 end
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now