Have three datetime columns in the following query that I want to compare. Estimated_arrival_date and receipt_date contain only a date value, delivery date contains both date and time values. I can compare estimated_arrival_date and receipt_date fine because the times show as all zeros, but how can I compare the delivery_date as it has both date and time?
select m.po_number,estimated_arrival_date, pod.delivery_date, r.receipt_date
from t_po_master m
LEFT OUTER JOIN t_po_detail pod
ON m.po_number = pod.po_number
LEFT OUTER JOIN t_receipt r
ON m.po_number = r.po_number
where estimated_arrival_date <> delivery_date