declare @fromdate datetime,@todate datetime select @fromdate='2015-11-06 11:59:48.000', @todate='2015-11-11 13:22:27.000' select * from BillDetails1 where ProductName ='chokalate' between @fromdate and @todate
Incorrect syntax near the keyword 'between'.
select * from BillDetails1 where ProductName ='chokalate' AND MyDateColumn between @fromdate and @todate
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)