I am trying to build a formula for what day we record shipping product. If we ship product before 21:00:00 we count that as same day and if it ships after 21:00:00 it would count towards the following day. I have the following built but am getting [Null] in my output. Not sure what I am missing - DateTime_Out is Time type and SHIPMENT_DATE is Date Type if that helps.
IF [DateTime_Out] < "21:00:00" THEN DateTimeAdd(DateTimeParse([SHIPMENT_DATE],"%d-%b-%y"),+1,"days") else [SHIPMENT_DATE] ENDIF
All suggestions / insights are appreciated!
In your Formula tool, what is the output data type for the new field you are creating?
If it's a Date, you don't need the DateTimeParse. Just use:
DateTimeAdd([SHIPMENT_DATE], 1, "days")
Chris
The output data type is date - tried using the following and still getting null in new column. IF [DateTime_Out] < "21:00:00" THEN DateTimeAdd([SHIPMENT_DATE],1,"days") else [SHIPMENT_DATE] ENDIF
hi @dmill8023
My guess is there is some confusion between Date, DateTime and Time formats between the various fields.
If we impose a Time format on a Date field (or vice versa impose a DateTime or Date format on a Time field), the value will be [null].
Dawn.
In the Results window screen shot below, the field data types are Date, Time, Date, String
The formula testing the Time field, and adding 1 to the Date field seems to be working OK.
Chris
i suspect the issue is with the field [Shipment date]. If that is not of the right type, the output is null, even then the "if conditions" part works.