The IIF, and Math tokens have been extended for conditional logic to support String delimiting (',") properly. The original version had issues when mathematical symbols were contained within string blocks. String delimited in single or double quotes will now be handled properly even when mathematic symbols appear within the syntax, e.g. '-1'='-660'.
In the older version, the previous statement was evaluated incorrectly because it literally split on symbols first, the previous statement would be come an evaluation of
a subtraction of a string against another string would result in a False value, because its not understood as a valid statement. Therefore you end up with False=False. Finally, False=False returns the valid result of True, even though -1 does not equal -600 which was the anticipated comparison.
Next, IIF and Math were extended to support Date and Timespan mathematics. Any Date can be compared, or altered using standard US date syntax (MM/dd/yyyy hh:mm:ss.ff tt). Date mathematics requires placing the Date value between a pair of pound signs (#).
- Comparison: #01/01/2010 10:00 AM# > #01/01/2010 9:00:AM# (All comparison symbols are supported
- Manipulation: #01/02/2010 10:00 AM# - #01/01/2010 10:00 AM# yields a Timespan in date format: #00/01/00 00:00:00.00#
- Manipulation: #01/02/2010 10:00 AM# + #05/00/00# yields a new date: #06/02/2010 10:00 AM#
- When the Timespan contains y,m and d - the timespan is not distinguishable from a date itself, so a timespan would need to have a trailing "ts" to identify it. For example: #01/01/2010# + #01/01/01 ts# yields #02/02/2011#
- When the manipulation is performed on date as both the left and right values, a timespan is the result
- When the manipulation is performed on date as the left, and timespan as the right, a date is the result
- When the manipulation is performed on timespan as the left and date as the right, a date is the result