• 0

# Calculate Time

## Question

Can you help with Case Statement involving a date/time field and a number field?

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

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

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

The sample result should be:
1/19/2020 11:29 AM

The time of 11:19([@field:Reminder_Date]) + the Value of the minutes 10([@field:Min_Rendered]).

## Recommended Posts

• 0

Hi,

As I understand your workflow, you would like to calculate the minutes of the timestamp by simply adding the number field to the time of your timestamp? With that, can you please try this either of these formulas:

First Formula:

CASE

WHEN [@field:Reminder_Date] IS NULL THEN 'Sample text'

WHEN [@field:Min_Rendered] IS NOT NULL THEN CONVERT(VARCHAR,(DateAdd(minute, [@field:Min_Rendered], [@field:Reminder_Date])))

ELSE 'Sample text'

END

Second Formula:

CASE
WHEN ([@field:Min_Rendered] IS NOT NULL AND WHEN [@field:Reminder_Date] IS NOT NULL) THEN DateAdd(minute, [@field:Min_Rendered], [@field:Reminder_Date])

WHEN [@field:Reminder_Date] IS NULL THEN 'Sample text'

ELSE 'Sample text'
END

I hope that helps.

## 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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.