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 2008 Forums
 Transact-SQL (2008)
 DATEPART

Author  Topic 

Naqibullah
Starting Member

7 Posts

Posted - 2014-10-20 : 01:38:20
Dear colleagues please help me solve this problem
how to return date part of datetime datatype, for example i want to return all records where orderDate is 15/10/2014

stepson
Aged Yak Warrior

545 Posts

Posted - 2014-10-20 : 01:40:58
[code]
WHERE orderDate >= '20141015'
AND orderDate <'20141016'
[/code]


sabinWeb MCP
Go to Top of Page

stepson
Aged Yak Warrior

545 Posts

Posted - 2014-10-20 : 01:42:02
or

SELECT CAST(getdate() AS DATE)



sabinWeb MCP
Go to Top of Page

mole999
Starting Member

49 Posts

Posted - 2014-10-20 : 11:40:57
where
OrderDate = '15/10/2014'

Mole
Go to Top of Page
   

- Advertisement -