Oops. Try this: <CFQUERY NAME="passport_attendance" dbtype="query"> SELECT passport_attendance_id FROM passport_attendance WHERE <cfif passport_registration.student_id[pr] is ""> people_id = <cfqueryparam value="#passport_registration.people_id[pr]#" cfsqltype="CF_SQL_INTEGER"> <cfelse> student_id = <cfqueryparam value="#passport_registration.student_id[pr]#" cfsqltype="CF_SQL_INTEGER"> </cfif> </CFQUERY>
Last one did not work because syntax should be "IS NULL" not "= NULL" On Fri, Jan 16, 2009 at 4:14 PM, daniel kessler <[email protected]> wrote: > ><CFQUERY NAME="passport_attendance" dbtype="query"> > >SELECT passport_attendance_id > >FROM passport_attendance > >WHERE student_id = <cfqueryparam > >value="#passport_registration.student_id[pr]#" cfsqltype="CF_SQL_INTEGER" > >null="#YesNoFormat(passport_registration.student_id[pr] is '')#"> > >OR people_id = <cfqueryparam value="#passport_registration.people_id[pr]#" > >cfsqltype="CF_SQL_INTEGER" > >null="#YesNoFormat(passport_registration.people_id[pr] is '')#"> > ></CFQUERY> > > That's interesting. I believe that I understand it fine. However, I am > still getting an error. Here's the whole error: > > Query Of Queries syntax error. > Encountered "student_id = NULL. Incorrect conditional expression, Expected > one of [like|null|between|in|comparison] condition, > > The error occurred in /afs/. > glue.umd.edu/department/oit/eis/webhosting/sph/htdocs/home/passport/attendance/attendance2.cfm: > line 129 > 127 : student_id = <cfqueryparam > value="#passport_registration.student_id[pr]#" cfsqltype="CF_SQL_INTEGER" > null="#YesNoFormat(passport_registration.student_id[pr] is '')#"> > 128 : OR > 129 : people_id = <cfqueryparam > value="#passport_registration.people_id[pr]#"cfsqltype="CF_SQL_INTEGER"null="#YesNoFormat(passport_registration.people_id[pr] > is '')#"> > 130 :</CFQUERY> > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318113 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

