Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-12-09
4
Medium Priority
?
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 49

Expert Comment

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

Accepted Solution

by:
sdstuber earned 1600 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 49

Assisted Solution

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

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

609 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