• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

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
0
MrDavidThorn
Asked:
MrDavidThorn
  • 2
1 Solution
 
Pratima PharandeCommented:
select (convert(varchar(10),getdate(),120))
0
 
Pratima PharandeCommented:
select (convert(nvarchar(10),getdate(),120))
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now