TicketSQL with Custom Fields


#1

Hello,

Attached to our tickets, we have a custom field called ‘Reminder
Interval’. In this field, a number is written in minutes. I would like
to create a query that checks if the last update has been longer that
the amount of minutes in this field. I would think that that query would
look like this:

Status = ‘open’ AND ‘CF.{Productomschrijving}’ IS NOT ‘NULL’ AND
LastUpdated < ‘CF.{Reminder Interval} minutes ago’

However, there is for example a ticket that has 15 in that custom field
and that hasn’t been updated in 2 hours.
If I have the query:
Status = ‘open’ AND ‘CF.{Productomschrijving}’ IS NOT ‘NULL’ AND
LastUpdated < '15 minutes ago’
this gives back the 1 result.

However if I use the first query, no results are returned.
Am I using an incorrect syntax?

Thanks,

Alain

Met vriendelijke groet,

Claranet Benelux BV

Alain Sips
Software Ontwikkeling


#2

Hello,

Attached to our tickets, we have a custom field called ‘Reminder
Interval’. In this field, a number is written in minutes. I would like
to create a query that checks if the last update has been longer that
the amount of minutes in this field. I would think that that query would
look like this:

Status = ‘open’ AND ‘CF.{Productomschrijving}’ IS NOT ‘NULL’ AND
LastUpdated < ‘CF.{Reminder Interval} minutes ago’

However, there is for example a ticket that has 15 in that custom field
and that hasn’t been updated in 2 hours.
If I have the query:
Status = ‘open’ AND ‘CF.{Productomschrijving}’ IS NOT ‘NULL’ AND
LastUpdated < '15 minutes ago’
this gives back the 1 result.

However if I use the first query, no results are returned.
Am I using an incorrect syntax?

Total guess here:

Is the db field some sort of text (varchar, etc)? If so you may need to
cast before doing a comparison.

Matt Zagrabelny - mzagrabe@d.umn.edu - (218) 726 8844
University of Minnesota Duluth
Information Technology Systems & Services
PGP key 1024D/84E22DA2 2005-11-07
Fingerprint: 78F9 18B3 EF58 56F5 FC85 C5CA 53E7 887F 84E2 2DA2

He is not a fool who gives up what he cannot keep to gain what he cannot
lose.
-Jim Elliot

signature.asc (189 Bytes)