Link to home
Create AccountLog in
Avatar of niceguy971
niceguy971

asked on

sql GETDATE()

select GETDATE() returns   2012-05-23 22:40:51.237

I want that date  without the time part : 2012-05-23 00:00:00.000

I can use SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) to get date  without the time part..
What would be the best  way to do it??

Thanks
Avatar of AncientAnt
AncientAnt

If you want to return a string, you can concatenation year(getdate()) +"-"+month(getdate())+"-"+day(getdate())
SOLUTION
Avatar of AncientAnt
AncientAnt

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account