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

Using getdate() to provide only short date

Hello, how can I use the getdate() function to only provide a short date like 12/31/2007 on an update statement?

I was thinking something like this would work but it is not...
update test
set modifieddate = getdate(convert, 101)
0
gogetsome
Asked:
gogetsome
1 Solution
 
srafi78Commented:
convert(varchar(10), getdate(), 101) will give you a date in short format
0
 
gjutrasCommented:
update test
set modifieddate = cast(convert(varchar(10),getdate(),101) as DateTime)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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