473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Finacial years

Hi

If i have a field in a database start date and end date, how am I able
to find out which financial years the two dates cover, and populate
colunms in a database with how many months in each financial year ie
if start date was 1/1/2004 to 1/1/2005 there would be 4 months in the
financial year 03/04 and 8 months in the financial year 04/05
Nov 12 '05 #1
4 1901
See if this helps --

From my files - see below my SIG
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

Get The Fiscal Year Or Fiscal Month Of A Particular Date By Using An Expression

To get the fiscal year or fiscal month for a OrderDate where the fiscal year
begins June 16 use the following expressions:

Fyear = Year([OrderDate])-IIf([OrderDate]<
DateSerial(Year([OrderDate]),6,16),1,0)

Fmonth = (Month([OrderDate])+IIf(Day([OrderDate])<16,6,7)-1) Mod 12+1 NOTE: The
FYear and FMonth expressions can be used for for any beginning date of a Fiscal
year by modifying the Date field, the day and the month, to the appropriate
values for the fiscal year. For example, if the fiscal year begins on 9/15 of
the current calendar year, you can modify the previous expressions as follows:

Fyear = Year([FieldName])-IIf([FieldName]<
DateSerial(Year([FieldName]),9,15),1,0)

FMonth: (Month([FieldName])+IIf(Day([FieldName])<15,9,10)-1) Mod 12+1
If the fiscal year begins on 9/15 of the previous calendar year, you can modify
the FYear expression as follows:

Fyear = Year([FieldName])-IIf([FieldName

"Mr C" <ma*********@hotmail.com> wrote in message
news:70*************************@posting.google.co m...
Hi

If i have a field in a database start date and end date, how am I able
to find out which financial years the two dates cover, and populate
colunms in a database with how many months in each financial year ie
if start date was 1/1/2004 to 1/1/2005 there would be 4 months in the
financial year 03/04 and 8 months in the financial year 04/05

Nov 12 '05 #2
I was able to get a working scenario together with the DateDiff()
function. However, you'll need to determine how your records will
handle projects longer than one year that span 3 fiscal years, for
instance. It's do-able, but requires some additional planning.

ma*********@hotmail.com (Mr C) wrote in message news:<70*************************@posting.google.c om>...
Hi

If i have a field in a database start date and end date, how am I able
to find out which financial years the two dates cover, and populate
colunms in a database with how many months in each financial year ie
if start date was 1/1/2004 to 1/1/2005 there would be 4 months in the
financial year 03/04 and 8 months in the financial year 04/05

Nov 12 '05 #3
The way I have tackled these situations is as follows:

In one field of my table, I would create a field as:
DateSerial(Year(Date()),Month(Date())+1,1)-1

This will set the date to the last day of the month. For this example,
I am calling this field "Period". If course you can have this update by an
update query or the example above uses today's date.
I would create another field Year. Use an update query as follows:
IIf(Month([Period])>8,Year([Period])+1,Year([Period])). If 8 (August) is
the last month of the fiscal year. Otherwise, change the formula to suite
your needs.
Hope this helps.

--
Dean Covey
www.coveyaccounting.com

MS-Office Certified:
http://www.microsoft.com/learning/mc...st/default.asp

"Mr C" <ma*********@hotmail.com> wrote in message
news:70*************************@posting.google.co m...
Hi

If i have a field in a database start date and end date, how am I able
to find out which financial years the two dates cover, and populate
colunms in a database with how many months in each financial year ie
if start date was 1/1/2004 to 1/1/2005 there would be 4 months in the
financial year 03/04 and 8 months in the financial year 04/05

Nov 12 '05 #4
dOn 8 Apr 2004 02:53:27 -0700, ma*********@hotmail.com (Mr C) wrote:
If i have a field in a database start date and end date, how am I able
to find out which financial years the two dates cover, and populate
colunms in a database with how many months in each financial year ie
if start date was 1/1/2004 to 1/1/2005 there would be 4 months in the
financial year 03/04 and 8 months in the financial year 04/05


Use a table.

--
Mike Sherrill
Information Management Systems
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bambero | last post by:
Hello all Problem like in subject. There is no problem when I want to count days between two dates. Problem is when I want to count years becouse of leap years. For ex. between 2002-11-19...
4
by: Mr C | last post by:
Hi If i have a field in a database start date and end date, how am I able to find out which financial years the two dates cover, and populate colunms in a database with how many months in each...
2
by: pierrelap | last post by:
Hello, I need to code a query that: 1-counts the number of time two companies have been in a deal together 2-in the five years that preceded the deal Lead Participant DealDate AAA BBB ...
6
by: carl.barrett | last post by:
Hi, I have a continuous form based on a query ( I will also be creating a report based on the same query). There are 2 fields: Date Obtained and Date Of Expiry I want a further 3 columns...
37
by: Gregc. | last post by:
G'day I'm trying to work out the number of years since 1970, here is my code: include <stdio.h> #include <time.h> const int SEC_IN_MIN = 60; const int SEC_IN_HOUR = SEC_IN_MIN * 60;
4
by: jamesyreid | last post by:
Hi, I'm really sorry to post this as I know it must have been asked countless times before, but I can't find an answer anywhere. Does anyone have a snippet of JavaScript code I could borrow...
0
by: AJAY SHARMA | last post by:
Can a critic of book 100 Years of E=mc2 be without NAME , PLACE and IDENTITY ? 100 Years of E =mc2 For details...
0
by: jyothi.priya143 | last post by:
Hi Friends, Urgent Requirement of FRESHERS (0 - 2 Years) are here for u now... Here u can upload a soft copy of ur resume in one click... Here U can also get Jobs-Freshers & Experienced, Sample...
2
by: ichew | last post by:
I have two dates - Date Joined and Actual Last Day. How do I find the YIS in for format of Years and Month from these two dates. Eg, Date Joined: 28/06/1971 and Actual Last Day: 24/01/2007, then...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.