date query | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

date query

hi,
i am designing website , where i m using ASP as frontend & MSSQL server 2k as backend.in one my table i taken one column as date_sub1,in which i m storing system date . i want to write such a query in which i will specify two dates for eg. (from)01/01/2006 & (To)04/04/2006. i will pass these two values to query,so that query should return me the result where date_sub1 is between these two dates. can anyone tell me how to write such query.
select <columnlist> from <tablename>
where date_sub1 between <fromdate> and <todate> cheers
Pali
Everything happens for your own good.

thanx chaloner for ur help, i was trying same thing,but i haven’t use single quote in date like ’01/01/2006′,it was not giving me result.
specify you date in YYYYMMDD or YYYY/MM/DD ——
> KH <
Refer this
http://www.sql-server-performance.com/fk_datetime.asp Madhivanan Failing to plan is Planning to fail
]]>