I was wondering if anyone new how to remove the time hh,mm,ss from the getdate? I am very new to using SQL and am having trouble. Right now I have the date added so it could always pull the current date and add one day to that. Now I need to remove the time from being shown completely. I do NOT want to change time to 00:00:00, I want it to be completely hidden.
Here is my code:
Select DATEADD(DAY, 1, GETDATE())
asked Jul 17, 2017 at 12:52
Venomous
371 gold badge1 silver badge8 bronze badges
-
3sql server? - CAST() the result to DATEAlex K.– Alex K.2017年07月17日 12:53:59 +00:00Commented Jul 17, 2017 at 12:53
1 Answer 1
Use CAST or CONVERT.
Using CAST
SELECT DATEADD(DAY,1,CAST(GETDATE() as date))
Using CONVERT
SELECT DATEADD(DAY,1,CONVERT(date,GETDATE()))
answered Jul 17, 2017 at 12:54
Rokuto
8141 gold badge11 silver badges16 bronze badges
lang-sql