Type mismatch for date 追蹤
Would anyone know why I'm getting type mismatch error when using a date field.
my_shelf = Field("ShelfLife_c")
mfg_date = Field("MfgDt") '<-- this is a date if i put it on the label it's in the format YYYY-MM-DD
if ( my_shelf = "-1" or my_shelf = "0" ) then
Value = "000000"
exp_date = DateAdd( "m", my_shelf, mfg_date ) '<-- this line is throwing the type mismatch error
Value = exp_date.ToString("MMYYYY")
I've tried doing cDate(Field("MfgDt") but that does nothing. It's like Bartender doesn't understand that Field("MfgDt") is a date. When I print the database field MfgDt on the label it shows 2018-05-14 so I know it's at least a date string.
Any idea how to fix this error?