January 5, 2006 at 4:06 pm
Hi,
I was wondering if someone could help me out. I would to get date in the following format:
mm/dd/yyyy hh:mi:ss
I have googled and checked the google site to no avail... the bol is a bit confusing. Could someone help me out with this request?
Thank you.
-----------------------------
www.cbtr.net
.: SQL Backup Admin Tool[/url] :.
January 5, 2006 at 4:22 pm
Check BOL again under the CONVERT function. There are no direct convert formats that give you this exact format, so you need to concatenate format 101 (mm/dd/yyyy) and format 108 (hh:mm:ss):
select convert(varchar, getdate(), 101) + ' ' + convert(varchar, getdate(), 108)
January 5, 2006 at 4:28 pm
PW, once again, thank you.
I was looking at the other functions (datediff, datepart, etc ...) and didn't look at convert.
-----------------------------
www.cbtr.net
.: SQL Backup Admin Tool[/url] :.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply