Solved

Date Conversions

Posted on 2009-07-06
3
126 Views
Last Modified: 2012-05-07
I need to return 'm/d/yyyy' for 'Business Date' and 'm/d/yyy 6:30 pm' for 'Time Submitted.  How do I change the values?

SELECT
            managerlog.Check_file_date as 'Business Date',
            managerlog.TimeSubmitted as 'Time Submitted',
            vUser_Info.First_Name as 'First Name',
            vUser_Info.Last_Name as 'Last Name',
            managerlog.Notes as 'Notes'
 
 FROM   ManagerLog ManagerLog INNER JOIN vUser_Info vUser_Info ON ManagerLog.UserID=vUser_Info.UserID

Thanks!

-Matt
0
Comment
Question by:mattkovo
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 24789945
check out the convert() function
            CONVERT(varchar(10), managerlog.Check_file_date, 101) as 'Business Date',
            CONVERT(varchar(20), managerlog.TimeSubmitted as, 101) 'Time Submitted',

Open in new window

0
 
LVL 17

Assisted Solution

by:pssandhu
pssandhu earned 250 total points
ID: 24790015
Yes, the CONVERT(varchar(10), managerlog.Check_file_date, 101) will you give the right format, however for hh:mm(AM/PM) angels second suggestion won't work. Try something like this:
Convert(varchar(10), managerlog.TimeSubmitted , 101)+' '+Right(Convert(varchar(30), managerlog.TimeSubmitted , 0),7)
P.
0
 

Author Closing Comment

by:mattkovo
ID: 31600394
Thanks guys.  I used a line from each!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now