Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Date range

Author  Topic 

eem_2055
Yak Posting Veteran

69 Posts

Posted - 2008-04-07 : 01:50:20
Hey guys..
pls help

what query should I do? Obtaining certain date only using SQL server2000?

Thnx...

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-07 : 01:52:58
WHERE DateCol >= @StartDate AND DateCol <=@EndDate
where @StartDate & @EndDate represent your daterange & DateCol is your table field containing date value.
If this doesnt answer your query you need to explain in detail what you're looking for.
Go to Top of Page

kiruthika
Yak Posting Veteran

67 Posts

Posted - 2008-04-07 : 01:57:14
Hi,
Use appropriate convert function to get the date only from a datetime column.

kiruthika
http://www.ictned.eu
Go to Top of Page

eem_2055
Yak Posting Veteran

69 Posts

Posted - 2008-04-07 : 02:03:34
thanks a lo1 !:)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-08 : 05:41:41
quote:
Originally posted by kiruthika

Hi,
Use appropriate convert function to get the date only from a datetime column.

kiruthika
http://www.ictned.eu


Thats not advisable. You shouldnt convert dates to varrchars and compare. To omit time part, use this

select dateadd(day,datediff(day,0,getdate()),0)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -