# Calculating a date field

This topic is 5773 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

Not sure whether this is the right forum. Apologies if not.

I have a table which lists business mileage. What I am aiming to do is to summarise the business mileage for a given tax year. (The tax year in the UK starts at the beginning of April)

I think that the best way to do this is to create a field that sets the current tax start date and then to create a related table that just shows the records starting after that date. If anyone has an easier way of doing this please shout!

So to achieve this I want a field that calculates the current tax year start date. Something like

`if(CURRENTMONTH<4,(1/4/CURRENTYEAR-1),(1/4/CURRENTYEAR).`

What I can't work out is the correct syntax of that calculation.

Any help appreciated!

TD

##### Share on other sites

1/4/CURRENTYEAR means "divide 1 by 4, then divide the result by CURRENTYEAR" (assuming CURRENTYEAR is defined somewhere). To construct a valid date from individual elements, use the Date() function.

To get elements of current date use the Get (CurrentDate) function, e.g. Year ( Get (CurrentDate) ) returns the current year.

##### Share on other sites

This topic is 5773 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account