Link to home
Start Free TrialLog in
Avatar of 1jaws
1jawsFlag for United States of America

asked on

datetime format

convert(varchar, dateSubmitted, 110) as dateSubmitted just gives me date a 08/15/2011 format and I want to also see time beside the date how to do that.. tsql
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

If you want to see the date and time, then why use the CONVERT function at all?
You can use CONVERT(varchar(20),DateSubmitted,0).  Look at the table in BOL to see what all the convert options do.
Avatar of 1jaws

ASKER

I need to use such as 08/15/2011 on the date part.. shows me Aug 15 2011
Then you need to combine two:

SELECT convert(varchar(8),DateSubmitted,101) + ' ' + convert(varchar(5),DateSubmitted,108)
Avatar of 1jaws

ASKER

still not right... it shows me as 08/15/20
SOLUTION
Avatar of lludden
lludden
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 1jaws

ASKER

still need a see AM, PM also :)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 1jaws

ASKER

thank you ewangoya! it works.. Ok, how should I give points now? :)

At your discretion, you can split or award all points according to the relevance and correctness of the solution
Avatar of 1jaws

ASKER

Thanks Guys!