Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Date Conversions

Posted on 2009-07-06
3
Medium Priority
?
135 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 750 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 750 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

670 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