Query tag: Issue with string tags inserted

I’m trying to retrieve the sum of hours of a certain type of operator logged entries (in the instance below it’s resolved) from a DB using the date range components. So, I had start date & end date properties from date range bound bi-directionally to date tags matching the DB date formatting (and then converted into strings).

It works perfectly only when replacing the inserted tags (in bold below) with the string value from the very same tag (i.e. ‘2016-12-13 16:50:59’). While I get Evaluation Error quality when using inserted string tag.

First post from a newbie, I hope the issue is clear :slight_smile:

SELECT SUM(DATEDIFF(hh, eventstart, eventend))
FROM ops_log
WHERE res LIKE ‘resolved’
AND eventstart >= {[.]Start_str} AND eventend >= {[.]Start_str} AND eventend <= {[.]End_str};

Did you try it with single quotes around your string variables?
AND eventstart >= ‘{[.]Start_str}’ AND eventend >= ‘{[.]Start_str}’ AND eventend <= ‘{[.]End_str}’;

2 Likes

It works. Thanks MMaynardUSG!