Hi guys,
bit of a tricky one here - at least for me anyway.
I have two tables named: products and deliveries.
products has a field called Delivery which I want to query and deliveries has a field called Date_Delivered which I want to query.
The where clause to select the records is a field called Nsn which is in both tables
I want to compare the date values from each which I will do using the DATEDIFF Sql function.
BUT. For the deliveries tables there may be multiple deliveries made against that order.
I have tried the code:
SELECT DATEDIFF(products.Delivery, deliveries.Date_Delivered)
FROM products, deliveries
WHERE products.Nsn='8455-99-132-8888' AND Deliveries.Nsn='8455-99-132-8888'
But this does not seem to work. Can someone firstly tell me if this is along the right lines, and if so correct it for me.
Will this work even though there may be multiple deliveries?