Jump to content
  • 0

Case Statement involving a date/time field an number field


KAPITYAN

Question

I am receiving an invalid formula error on the following:
CASE WHEN [@field:END_Pickup] IS NOT NULL THEN [@field:Carrier_Date] + Try_Convert(datetime, [@field:END_Pickup])ELSE 'END Not Provided'END

Carrier_Date is a date/time datatype and END Pickup is a number datatype. But the value of the Carrier_Date field upon record update form element is a TimeStamp.

My current workflow:
When the Carrier User submits the record, they fill out how many minutes they are from the pick-up site. Upon submit there is a Timestamp. For the Company user, when they view the record, I am trying to give the estimated ETA END. So the timestamp + the number of minutes.

The sample result should be:
2/21/2020 11:39 AM

The time of 11:24([@field:Carrier_Date]) + the Value of the minutes 15([@field:END_Pickup]).

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

As I understand it, what you are trying to do is to add minute values to your timestamp based on when the field [@field:END_Pickup] is null?

If the [@field:END_Pickup] is blank, the result of the formula should be the date on the [@field:Carrier_Date] + the number of minutes stated on the field [@field:ETA_to_Pickup].

If the above statements are correct, may you please try using this formula:

CASE WHEN [@field:END_Pickup] IS NOT NULL THEN DateAdd(minute, [@field:END_Pickup], [@field:Carrier_Date]) ELSE 'END Not Provided'END

I hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...