### Title

Set Field does not evaluate correctly

### Post

Set Varable [$postedDate: value:

Let ( [

~dt = Get ( CurrentDate ) ; // This is just to shorten the date calc

~dow = DayOfWeek ( Get ( CurrentDate ) ) ; // This is the day number of the date

~delay = 3 ]; // The number of days back you want

~dt - // Start with today

( ~delay + // Subtract delay plus...

Case ( ~dow < 5 ; 2 ) // plus 2 if the result would be a weekend day

) // End calculation of amount to subtract

) // End Let

This correctly evaluates to 7/16/2013... so $PostedDate = 7/16/2013

Why doesn't this evaluate correctly? Set Field [Invoice::INPostedDate; "2/01/2013...$PostedDate"]

If you used exactly what you posted, you'd get a syntax error so I would guess that what you really have is:

Set Field [Invoice::INPostedDate; "2/01/2013...$PostedDate"]

IF that's what you have, the variable is enclosed in your quotes and that causes fileMaker to see $PostedDate as literal text, not a variable containing a value. Use:

Set Field [Invoice::INPostedDate; "2/01/2013...

" &$PostedDate]