I have the following query where the user will put in a date.  They will
put it in like '01/01/04'.  I use this date in my WHERE clause but MySQL
needs the date like '2004/01/01'.  I tried using Date_Format('04/01/01',
'%Y-%m-%d') to change the way it is formatted but I don't get the
correct data back.  Can someone help with this?
 
SELECT DISTINCTROW Products.NSIPartNumber, Sum(tblInvTransaction.Qty)
AS SumOfQty
FROM tblInvTransaction INNER JOIN Products ON
tblInvTransaction.ProductID = Products.ProductId
WHERE tblInvTransaction.Date <= Date_Format('01/01/04', '%Y-%m-%d')
GROUP BY Products.NSIPartNumber
HAVING Sum(tblInvTransaction.Qty)>0;

Reply via email to