0

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
1
  • 3
    sql server? - CAST() the result to DATE Commented Jul 17, 2017 at 12:53

1 Answer 1

3

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
Sign up to request clarification or add additional context in comments.

2 Comments

If you give 2 answers, then give 2 examples to justify your answer.
@WEI_DBA you are right. I've edited answer. Thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.