; This takes the value 1, adds the year portion of @DATE as a string..
; starting the formula with a number causes Kix to convert the string
; to a number. The value 1 is then subtracted. Again, the long way to get there..
; $SY = Val(Left(@DATE, 4)) is less obscure, but $SY = @YEAR gets the job
; done directly
$SY = 1 + left(@date,4) - 1
; This converts to a 2-digit year, again wrapping it in a formula to
; return a number. Just as strange, and can be simplified to
; $SystemYear = Val(Right(@YEAR, 2))
$SystemYear = 1 + right($SY,2) - 1
; more of the same.. simplify to
;$SystemMonth = @MONTHNO
; and
;$SystemDay = @MDAYNO
$mn1 = 1 + right(@date,5) - 1
$SystemMonth = 1 + left($mn1,2) - 1
$SystemDay= 1 + right(@date,2) - 1
; Given that today is 2010/03/25, your formula works out to:
; $SystemYear = 10, $SystemMonth = 3, and $SystemDay = 25
; (by whatever method you choose)
; $SystemDays = (10 * 365) + (3 * 30.4167) + 25
; $SystemDays = 3650 + 91.25 + 25, or simply 3766.25
$SystemDays=($SystemYear*365)+($SystemMonth*30.4167)+$SystemDay