Solved

Date Conversions

Posted on 2009-07-06
3
131 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 143

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

756 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