#Operator '>' can't be used with text values

Hello,
I am trying to calculate a new column SLA. I am receiving the error below. The column Cert_Time will not format to a number. Do you have a workaround for this "user error"

  1. Imported as txt
    image

2.Calculate a new column – Cert_Time - right([CertificationDate],8)
image

  1. Calculate a new column - SLA - if [Cert_Time] >'14:59:59' THEN 'Out of SLA' ELSE 'In SLA'
    This is the error I am getting - #Operator '>' can't be used with text values
    image

You have to convert them to numbers first.

When converting the CertificationDate to numbers then the Calculate new column for Cert time comes out like this. How do I work with this formated time?

image

With a number format, it shows like this when I look at it in the filter list.
But when I try to capture the right lef 8 (time) it returns the last 8 digits 19285185. How do I handle this instance?
image

You don't need to extract the time part from the timestamp. Compare the timestamp (as number) with a calculated point in time:

if [Cert_Time] > addhours(truncate([Cert_Time]),15) THEN "Out of SLA" ELSE "In SLA"

Here, the truncate() function applied to a date removes the time part. Then the addhours() function adds 15 hours. This is the calculated point in time to compare with.

UPDATE
Added a sample project.
timestamp comparison.morph (2.8 KB)

This worked!!! Excellent idea !! Can you recommend a book I can get to reference these types of statements or at least try to write them like you do?

Thank you for your support!!!!

You're welcome, Teri :slight_smile:

Hmm... I'm not aware of any book that can teach it. You can start with the tutorial article on expressions here: EasyMorph | Type system and expressions

If you run into a case that you don't know how to handle, feel free to post it on the forum.