I am getting this error multiple times:
An expression of non-boolean type specified in a context where a condition is expected, near ')'
with this chunk of code:
select distinct a.city from trans_link tl, custom_field_value cfv, person p, addresses a, custom_field_value cfv2, pick_list pl
where tl.transact_id = 8
AND tl.translink_id = cfv.primary_id
AND cfv.field_id in (750, 757, 769)
and tl.primary_person_id = p.person_id
and p.address_id = a.address_id
AND tl.inst_id = cfv2.primary_id
AND cfv2.field_id = 322 AND ISNUMERIC(cfv2.value_data) = 1
AND convert(decimal(16,4),'0' + Rtrim(Ltrim(Replace(Replace(cfv2.value_data,'$',''),',','')))) in (@hv_lead@)
AND convert(decimal(16,4),'0' + Rtrim(Ltrim(Replace(Replace(cfv2.value_data,'$',''),',','')))) > 0
AND a.country = 'United States' and a.state = pl.name and pl.category_id = 'State List' and pl.picklist_id in (@your_state@)
any help would be greatly appreciated!! Thanks in advance.