Search code examples
sqlcoldfusioncfml

how to result two values inside one variable in cfscript/cfml


hi I am converting a sql statement where I have a where clause and a in operator in it where I am trying to get the two id numbers to show the record on screen. But for some reason I only get the first id to print on the screen so. Here is a snippet to my code.

if (item.employeeId == '878789' && '987348'))

and my sql statement where clause looks like this.

where employee_id in ('878789', '987348')


Solution

  • I assume the problem with if statement, try

    if (item.employeeId == '878789' || item.employeeId == '987348'))