SQL Query: Using IF statement in defining new field

Posted by Tofig Hasanov on Stack Overflow See other posts from Stack Overflow or by Tofig Hasanov
Published on 2010-05-08T08:48:05Z Indexed on 2010/05/08 8:58 UTC
Read the original article Hit count: 149

Filed under:
|
|

I have a table with many fields and additionally several boolean fields (ex: BField1, BField2, BField3 etc.). I need to make a Select Query, which will select all fields except for boolean ones, and a new virtual field (ex: FirstTrueBool) whose value will equal to the name of the first TRUE Boolean Field.

For ex: Say I have BField1 = False, BField2 = True, BField3 = true, BField4=false, in that case SQL Query should set [FirstTrueBool] to "BField2". Is that possible?

Thank you in advance.

P.S. I use Microsoft Access (MDB) Database and Jet Engine.

© Stack Overflow or respective owner

Related posts about delphi

Related posts about query