McGoo Posted February 16, 2004 Posted February 16, 2004 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
jonesy17 Posted February 16, 2004 Posted February 16, 2004 I think you're missing some brackets. After your "else" try: Set Field(Date Of Leaving,TextToDate("<1/10/" & (Year(Today) - 1)) note the extra brackets around (Year(Today) - 1)
John Caballero Posted February 16, 2004 Posted February 16, 2004 Try Insert Calculated Result as opposed to Set Field.
kenneth2k1 Posted February 16, 2004 Posted February 16, 2004 ...And make sure the date field you are calculating is on the current layout when the script executes.
Vaughan Posted February 16, 2004 Posted February 16, 2004 ... 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))]
McGoo Posted February 18, 2004 Author Posted February 18, 2004 Thanks everyone I managed to overcome that problem........much appreciated
Recommended Posts
This topic is 7588 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 accountSign in
Already have an account? Sign in here.
Sign In Now