asked on
declare @po_start_date varchar(15)
declare @po_end_date varchar(15)
SELECT
ex.vendor_code,
ex.program,
ex.Po_num,
ex.date_create,
ex.Printed_Date,
ex.status,
ex.po_item_No,
ex.Supplier_pn,
ex.price,
ex.unit_of_meas,
ex.extd_cost,
ex.quantity,
ex.open_qty,
ex.baseline_date,
ex.[Current_Date],
ex.nomenclature,
ex.customer_no,
ex.control_and_item,
ex.need_date,
ex.fax,
ex.state,
ex.vendor_name,
ex.vendor_phone,
ex.vendor_contact,
ex.disposition,
ex.ship_via,
ex.need_date3,
ex.a_status,
ex.data,
ex.next_higher_assy
FROM
expeditetbl1 ex
left join
(
select
emp_num, pGM_CODES
from exp_dummytbl
group by emp_num, pGM_CODES
)
Q ON ex.program = Q.pGM_CODES
where Q.emp_num='092'
and ex.vendor_code IS NOT null
and ex.open_qty <> 0
and (ex.program ='632'
and Case
When @po_start_date <> ''
Then (ex.[Current_Date] > = @po_start_date)
END