Jump to content
Sign in to follow this  

Set Field with Date Calculation

Recommended Posts

Hi -

I have a script where the first section does a find for me. I have created the find using Set Fields. One of the Set Fields is on a Calculation(Date) field.

Set Field [NextInvoiceDateQuarterly, ">= Status(CurrentDate)"] - - - this is my line in ScriptMaker

When I run my script - just get a question mark in that field and I have to modify it manually or cancel my script.

I have tried changing the Set Field command to Insert Calculated Resut, but then it just literally enters ">= Status(CurrentDate)" and tells me I can't have that because the field is a Date field.

I want the field to be found on >= and the current date. I can do this manually - so I know there must be a way to do it within ScriptMaker.

Thanks for your help.

Share this post

Link to post
Share on other sites


That's a good question. I have one solution for scripting this action, but I'm not sure if it's the best. If Someone has a better one, let me know because I am looking for something a little simpler. There is also another easier alternative that is listed at the end of this post.

Anyway, it looks like this:

Enter Find Mode [ ]

Go to Layout [Layout you're date field is on]

Insert Calculated Result [NextInvoiceDateQuarterly, ">="]

Insert Calculated Result [NextInvoiceDateQuarterly, " Date( Month(Status( CurrentDate)) , Day(Status( CurrentDate)) , Year(Status( CurrentDate)))"]

Perform Find [ ]

Make sure that you DO NOT "Select Entire Contents" on the Insert Calc Result script steps, and you do not restore find requests. The reason why it won't work the way you have entered it is because the "" marks insert the exact phrase you put in, which is not a date.

Now, you do have another simpler option. I just wanted to post that other stuff to maybe get some other people's feedback.

You can do your find manually, then, right after, go to scriptmaker and make a script that goes like this:

Perform Find [Restore]

That's all. It will perform your last manual find.

Have fun!


Share this post

Link to post
Share on other sites

You were almost there...

Enter Find Mode []

Insert Calculated Result[NextInvoiceDateQuarterly,">=" & DateToText(Status(CurrentDate))]

Perform Find []

You can't use Set Field because set field requires that the output be in the field format of the destination field, so ">=3/4/2002" is not a date - but Insert Calculated Result will let you do this.

Share this post

Link to post
Share on other sites


I've tried TextToDate and it didn't work, but for some reason I never thought about DateToText!! Thanks! That solves alot of problems for me!


Share this post

Link to post
Share on other sites

Wow -

That worked wonderfully!!! Thank you for your help.

Now - I have some sorting issues to work through - but those shouldn't be a big deal.

Thanks again

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

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