473,662 Members | 2,622 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tax Year Function

Hi

Does anyone know of a function I can use to return the current tax
year. Our tax year runs from 6 April. I need a function which will
return the tax year for a given date.

TIA

Nov 13 '05 #1
3 3259
It's not elegant, but here is one you can modify for your own use:

Public Function FY(varDate As Variant)

If IsNull([varDate]) Then FY = "": Exit Function

If ([varDate] >= #7/1/2002# And [varDate] <= #6/30/2003#) Then FY = 2003
If ([varDate] >= #7/1/2003# And [varDate] <= #6/30/2004#) Then FY = 2004
If ([varDate] >= #7/1/2004# And [varDate] <= #6/30/2005#) Then FY = 2005
If ([varDate] >= #7/1/2005# And [varDate] <= #6/30/2006#) Then FY = 2006
If ([varDate] >= #7/1/2006# And [varDate] <= #6/30/2007#) Then FY = 2007
If ([varDate] >= #7/1/2007# And [varDate] <= #6/30/2008#) Then FY = 2008
If ([varDate] >= #7/1/2008# And [varDate] <= #6/30/2009#) Then FY = 2009
If ([varDate] >= #7/1/2009# And [varDate] <= #6/30/2010#) Then FY = 2010
If ([varDate] >= #7/1/2010# And [varDate] <= #6/30/2011#) Then FY = 2011
If ([varDate] >= #7/1/2011# And [varDate] <= #6/30/2012#) Then FY = 2012
End Function

-Ed
<et*******@blue yonder.co.uk> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Hi

Does anyone know of a function I can use to return the current tax
year. Our tax year runs from 6 April. I need a function which will
return the tax year for a given date.

TIA

Nov 13 '05 #2
Try:
Year([InvoiceDate]) + ((Month([InvoiceDate] > 4) OR (Month([InvoiceDate] = 4
AND Day([InvoiceDate]) >= 6))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<et*******@blue yonder.co.uk> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .

Does anyone know of a function I can use to return the current tax
year. Our tax year runs from 6 April. I need a function which will
return the tax year for a given date.

Nov 13 '05 #3
Function TaxYear(varDate ) as integer
If varDate < DateSerial (Year(varDate), 4, 6 ) then
TaxYear =Year(varDate) -1
else
TaxYear=Year(va rDate)
end function

--
Hope this helps
Arno R
<et*******@blue yonder.co.uk> schreef in bericht
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Hi

Does anyone know of a function I can use to return the current tax
year. Our tax year runs from 6 April. I need a function which will
return the tax year for a given date.

TIA

Nov 13 '05 #4

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

Similar topics

2
2055
by: ltamisin | last post by:
Hi Im working on a Year(Date) function right now, the output of that function is this "2005", my question is how can i change the format into this "05" Function: Year(Date) Output: 2005 Needed Output: 05 Thanks
7
1897
by: Fendi Baba | last post by:
The function is called from opencalendar(targetfield). Thanks for any hints on what could be the problem. .............................................................. var decimalPointDelimiter = ".";
14
4755
by: Protoman | last post by:
Hi!!! I need some help on a project I'm that calculates leap years; I'm getting errors that I have no idea what they mean; here's the code: #include <iostream> #include <cstdlib> using namespace std; class Year { public:
2
2426
by: Douglas | last post by:
I have a Vehicle MOT field in my table which i have as a Date field I dont really want to hold the year, just 'dd mmm' as MOTs are the same date every year. I have the field on my form as a listbox holding all the dates of the year, except 29 Feb which i dont need anyway. When i select a value from the list i.e. 14 May and it stores it in the table i believe it stores the current year as well i.e 14 May 2004 The problem now is how do i...
14
4346
by: Alan | last post by:
Hi everyone! I'm trying to produce a periodic financial report on projects from various departments. My database is set up with the tables tblDepartment, tblProjects, tblPeriods, and tblBudgets -- the first three serve the obvious function; the last table contains foreign keys to tblProjects and tblPeriods, each record corresponding to a project's budget for a particular period. Periods are also grouped by years (a seperate field for...
18
3981
by: Bruno Baguette | last post by:
Hello, I have to design a table wich will store some action reports. Each report have an ID like this 1/2004, 2/2004, ... and each years, they restart to 1 (1/2004, 1/2005, 1/2006,...). So, I was thinking to split that in two fields : one with the increment and one with the year. But I don't know how can I manage the sequences since I have to restart to 0 each year...
3
16510
by: jannoergaard | last post by:
Hi I want to write a function that can return a sum for a given date range. The same function should be able to return the sum for the same period year before. Let me give an example: The Table LedgerTrans consist among other of the follwing fields AccountNum (Varchar) Transdate AmountMST (Real)
4
1623
by: ssylee | last post by:
I have set my year value in the register on my RTC (DS1302) to be 2008 using this code: // This function sets the year on the RTC // Note: The year takes in only the last two digits of the year only // and valid for only 2000 to 2099 void set_year(unsigned int year) { unsigned int year_temp; unsigned char year_write = 0;
4
4420
by: hallsers | last post by:
Here is the problem i am having: - When a user logs in, on page load it will take the dob of all users in a stored friends list and compare them against the following conditions - To display any friends with a birthday inside the next 3 days, taking into account leap years for some1 born on the 29th of feb to be born on 28th in non leap years and also to display their age with the reminder. Here is code i have picked up so far. 1. ...
0
8344
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8764
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8546
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7367
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5654
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.