How to convert content of UDF/userfield into numeric datafromat for use in if/then statement
Hello,
data format of all udf/userfields in beas ist string. As far as I know, this cannot be changed. The settings e.g. on setup wizard only influence the look of the value in the data fiel. The value in the table stays in string forma. if/then statements with operators like > or < require numeric data format.
I am looking for way to transfer the content of an udf into numeric data format so I can use it in an if/then/else statement? Is this possible?
What I am trying to do: The user on the shop floor enters a value in the time receipt (saved into udf). Depending on the value (<X or >X) the booking of the time receipt should be cancelled or not.
An answer would be appreciated.
Kind Regards,
Patrick
-
if you format a string field with date format string, the system convert the field to Date and then back to string with defined format
Example:
messagebox=<udf1,yyyymmdd>
Convert field to date and back to string in format year - month - dd
Now you can use this as number
if you use n< n= or n>
if <udf1,yyyymmdd> n< <today,yyyymmdd> then
messagebox=Date in past not allowed ...
end if
regards
Martin -
Dear Martin,
thank you very much!
Please sign in to leave a comment.
Comments
2 comments