i have a table named Tbl_Product having columns (id,PName,PTime)---- (1,Nokia,1/20/2012 7:02:09 PM) (2,Samsung,1/21/2012 7:02:09 PM) (3,Micromax,1/20/2012 7:02:09 PM) (4,Tablet,1/21/2012 7:02:09 PM) (5,Pendrive,1/20/2012 7:02:09 PM) now i want to select data in a such manner date shoud be 1/20/2012 compare only 1/20/2012 and bind it to GridView.......help me....
SELECT * FROM Tbl_Product WHERE CAST(PTime AS Date)='2012-01-20'
SELECT * FROM Tbl_Product WHERE Year(PTime) = 2012 AND Month(PTime) = 1 AND Day(PTime) = 20
select Convert(nvarchar(10),date,101) as date from date1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)