tsql Coverting date

Hi Experts

I have a datetime output in SQL 2005 I am converting this to a string value and want to output as yyyy-mm-dd
If I use
select (convert(nvarchar(50),getdate(),120))
it returns the datevalue I want but also includes the time, is there a way I can just get the date without using the left command

Thanks
MrDavidThornAsked:
Who is Participating?
 
Pratima PharandeCommented:
select (convert(varchar(10),getdate(),120))
0
 
Pratima PharandeCommented:
select (convert(nvarchar(10),getdate(),120))
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.