Recent

Author Topic: TSQLQuery.Filter problem with select iif()  (Read 1013 times)

jojo86

  • Jr. Member
  • **
  • Posts: 52
TSQLQuery.Filter problem with select iif()
« on: February 15, 2019, 12:02:56 am »
Hi,

I have a sql query with a iif() inside the select.
The filter method can't works with this calculated field.

Filter works with all my other fields, but not with the statut field :
Code: Pascal  [Select]
  1. select Name, Adresse, iif(xyz<opt, 'OK', 'KO') as Statut
  2.  

How can I solve my problem ?
Thanx




dsyrios

  • Jr. Member
  • **
  • Posts: 57
Re: TSQLQuery.Filter problem with select iif()
« Reply #1 on: February 15, 2019, 06:13:45 am »
Maybe, try this...

Code: Pascal  [Select]
  1. SELECT Name, Adresse, CASE WHEN xyz<opt THEN 'OK' ELSE 'KO' END AS Statut  FROM ...
  2.  
« Last Edit: February 15, 2019, 06:26:23 am by dsyrios »
Laz 2.0.2/FPC 3.0.4/ win10/64
Laz 2.0.0/FPC 3.0.4/ mint-mate 19.1