Trilochan Sahu Trilochan Sahu - 5 months ago 13
SQL Question

MS access between clause not Working

MS access between clause not Working(between 2 dates).

My query is below:

SELECT [Supplier].sname,
[Supplier].scontact,
[Supplier].sadd,
[Purchase].qnt,
[Purchase].item,
[Purchase].price,
[Purchase].priceperkg,
[Purchase].date,
[Purchase].suppid,
[Purchase].purchaseid
FROM Purchase
INNER JOIN Supplier
ON Purchase.suppid = Supplier.sid
WHERE [Purchase].date BETWEEN date= ? AND ?

Answer

WHERE [Purchase].date BETWEEN date= ? AND ? is not valid syntax. Try:

WHERE   [Purchase].date BETWEEN ? AND ?