How to find out data of a table by date

Dotnet4ashu
Posted by Dotnet4ashu under Sql Server category on | Points: 40 | Views : 889
create table t1

(
id int,
name varchar(20),
date1 datetime
)


from wizard mode select date1 field (on its column properties) set its value to getdate() function


Query

select * from t1 where convert(varchar(10),date1,103)='02/12/2012'

here
we need to convert datetime datatype
date1 is our field name and
103 is our datetime format = DD/MM/YYYY


for more further help go to link below
http://www.sql-server-helper.com/tips/date-formats.aspx

Comments or Responses

Login to post response