?
Solved

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

Posted on 2014-12-09
4
Medium Priority
?
156 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 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