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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 getting problem in date

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-11-07 : 09:04:37
Salim writes "Hi,

I am using sql server 2000 and i have a problem

I am not able to get the yyyymmdd part from a field which is having data type datetime.
I have a record ahving an entry 11/1/2001
i tried to acces it by
select * from customer where purchase_date = getdate()-1
getdate()-1 returns me yesterday's date and time but in database this perticular entry is 20001-11-01 00:00:00
so it returns me 0 records

please tell me how to extract yyyymmdd part from dattime field

Please reply me soon

Thank you"
   

- Advertisement -