[rt-users] TicketSQL with Custom Fields

Matt Zagrabelny mzagrabe at d.umn.edu
Wed May 21 12:04:27 EDT 2008


On Wed, 2008-05-21 at 17:19 +0200, Alain Sips wrote:
> 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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20080521/091c219c/attachment.sig>


More information about the rt-users mailing list