Solved

# Fiscal Year Calculation

Posted on 2009-12-17
Medium Priority
621 Views
Hi experts,

I copied DatabaseMX's code as following from EE, used it in my database, it's so beautiful.
=DatePart("q",DateAdd("m",-3,[starttime])) & "-" & Year([starttime])-IIf(Month([starttime])>=3,0,1) & "/" & Year([starttime])-IIf(Month([starttime])>=3,0,1)+1
Now I'd like to have the year part only like 2009/2010, I'm assuming I took out the first part it would work, the code like the following:
=DatePart(Year([starttime])-IIf(Month([starttime])>=3,0,1) & "/" & Year([starttime])-IIf(Month([starttime])>=3,0,1)+1
But it says "The expression you entered is missing a closing parenthesis, bracket (]), or vertical bar (1).

Thank you!

0
Question by:howruaz9
• 2

LVL 16

Expert Comment

ID: 26072960
just put format(xxx, "yyyy") around the original code (insert code in place of xxx)
0

LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 26073106
you don't need the function DatePart if you just want to get 2009/2010 format

try this

= Year([starttime]) - IIf(Month([starttime]) >= 3, 0, 1) & "/" & Year([starttime]) - IIf(Month([starttime]) >= 3, 0, 1) + 1
0

Author Closing Comment

ID: 31667354
Thank you, cap. What can I say, you are genius.
I wish you a very happy holiday season!
0

Author Comment

ID: 26073296
Thank you, kmslogic and capricorn1. However cap's is working with no trouble. Wishing you all the best!!!
0

## Featured Post

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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 Month13 days, 14 hours left to enroll