C
C#9mo ago
mrdudebro1

how to use 'like' in SSRS

HI ALL. i have a query where i'm trying to use 'like' with a parameter and it doens't seem to be working.
select po_hdr.po_no, po_hdr.order_date, po_hdr.created_by, expdite_date, next_action, vendor_name, supplier_so, contact_id,
contacts.email_address, contacts.direct_phone, contacts.home_phone, contacts.phone_ext, ackn_date
from po_hdr_ud
join po_hdr on po_hdr.po_no = po_hdr_ud.po_no
join vendor on vendor.vendor_id = po_hdr.vendor_id
left join contacts on po_hdr.contact_id = contacts.id
WHERE (po_hdr.po_no = @RG_PO_NO or @RG_PO_NO is null) AND (po_hdr_ud.supplier_so LIKE @Supplier_SO or @Supplier_SO = '') AND (vendor_name like '*'+@
Supplier_Name+'*' or @Supplier_Name = '') and (po_hdr.created_by LIKE @RG_Buyer or @RG_Buyer = '')
select po_hdr.po_no, po_hdr.order_date, po_hdr.created_by, expdite_date, next_action, vendor_name, supplier_so, contact_id,
contacts.email_address, contacts.direct_phone, contacts.home_phone, contacts.phone_ext, ackn_date
from po_hdr_ud
join po_hdr on po_hdr.po_no = po_hdr_ud.po_no
join vendor on vendor.vendor_id = po_hdr.vendor_id
left join contacts on po_hdr.contact_id = contacts.id
WHERE (po_hdr.po_no = @RG_PO_NO or @RG_PO_NO is null) AND (po_hdr_ud.supplier_so LIKE @Supplier_SO or @Supplier_SO = '') AND (vendor_name like '*'+@
Supplier_Name+'*' or @Supplier_Name = '') and (po_hdr.created_by LIKE @RG_Buyer or @RG_Buyer = '')
when i type in a value into the supplier_name parameter that SHOULD return something .it returns nothing
3 Replies
Mayor McCheese
Mayor McCheese9mo ago
are you using the partial match component of like?
mrdudebro1
mrdudebro1OP9mo ago
i figured it out you have to do '%' + @param + '%' this is in the dataset query itself
Mayor McCheese
Mayor McCheese9mo ago
that's what I was guessing
Want results from more Discord servers?
Add your server