SELECTWhen you run this query, the correct vendor codes display in the data output, but when they added the following vendor condition to the WHERE clause, get no results.
ir.invoice_number_text AS "Invoice Number",
ir.grand_total_amt AS "Total",
irs.vendor_code
FROM
sierra_view.invoice_record ir
JOIN
sierra_view.invoice_record_vendor_summary irs
ON irs.invoice_record_id = ir.id
WHERE
ir.paid_date_gmt BETWEEN '01/22/2014' AND '01/23/2014'
WHERE
ir.paid_date_gmt BETWEEN '01/22/2014' AND '01/23/2014'
AND irs.vendor_code = ‘oing’
Turns out you need to say irs.vendor_code = ‘oing ’
vendor code followed by space. The vendor code field is defined as 5 characters, ansd any codes less than 5 characters get padded with trailing spaces
No comments:
Post a Comment