Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Link to comment
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.

Link to comment
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.