?
Solved

Fiscal Year Calculation

Posted on 2009-12-17
4
Medium Priority
?
621 Views
Last Modified: 2012-06-22
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).
Please advise.

Thank you!


0
Comment
Question by:howruaz9
  • 2
4 Comments
 
LVL 16

Expert Comment

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

Accepted Solution

by:
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

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

Author Comment

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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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

807 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