Jump to content

Just Will Not Work


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

Recommended Posts

Hi all

I am trying to write a script that will find a specific date depending on the current month. If it is October, November or December I want the find in the script to the 1st October and the current year. If it is the rest of the year I want it to find 1st October and the previous year.

My script is currently

Enter Find Mode

If(month(Today) >= 10

Set Field(Date Of Leaving,TextToDate("<1/10/" &Year(Today))

Else

Set Field(Date Of Leaving,TextToDate("<1/10/" & Year(Today) - 1)

End If

Perform Find

What am I doing wrong???

Please Help

Thanks

Link to comment
Share on other sites

... and use Status(CurrentDate) not the TODAY function.

I just noticed the TextToDate() function in there. TextToDate will break if the solution is used on a machine set to a different date format (eg, Australian instead of US). Use Date() instead.

So, putting it all together...

Insert Calculated Result [Date Of Leaving, "<" & DateToText(Date(1, 10, (Year(Status(CurrentDate)) - 1))]

Link to comment
Share on other sites

This topic is 6553 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
 Share

×
×
  • Create New...

Important Information

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