ExecuteSQL not finding value of 0?

Discussion created by BruceHerbach on Jan 29, 2018
Latest reply on Jan 30, 2018 by okramis

I'm working on a script that should pull a set of primary keys when there is a match for 3 pieces of information.  Here is he basic query:


FROM "Message" a

WHERE a."ID_Staff" = ? AND a."Mailbox_ID" = ? AND a."viewed" = ?


ID_Staff and Mailbox_ID are text fields and viewed is a number field.


When the values are:

ID_Staff = 10,

Mailbox_ID = 633 and

viewed = 1

it pulls the correct data set.   When viewed has a value of 0 no records are returned.  Going to the base table and doing a find with the same values finds the correct record set.  So the SQL should work.


Is there something that should be different for number fields with a value of 0?  Any suggestions on this would be greatly appreciated.