IIF is a ColdFusion method, you can't use it in SQL like that. What you're probably looking for is CASE:
CASE WHEN u.userid = s.lead_mgr THEN u.first ELSE s.lead_note END AS leadMgr Francois Levesque http://blog.critical-web.com/ On Mon, Jul 20, 2009 at 9:31 AM, RamaDevi Dobbala <[email protected]>wrote: > > <cfquery datasource="askseaton" name="get_offices1" result="log"> > select s.office_name,u.userid,s.lead_mgr,iIf(u.userid = s.lead_mgr, > u.first , s.lead_note ) as leadMgr > from sourcebook_1 s ,user_info u > where s.active = 1 > and office_id not in(36,37,38,73) > order by s.office_number > </cfquery> > > is this is correct comparision,please tell me > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324715 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

