Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
I need to extract the time only from a date/time field (dbo.EmployeeTimeEvent.Time). If I need to is it possible also to set the time in AM/PM instead of military time?
select dbo.Batch.ReportDate as job_date, dbo.EquipmentLaborEvent.Hours as equipment_hours, dbo.EmployeeTimeEvent.Time as event_time, substring(dbo.EmployeeTimeEventType.Name, 1, 20) as event_type
tkizer
Almighty SQL Goddess
38200 Posts
Posted - 2008-08-12 : 16:34:16
Use CONVERT function with the appropriate style.Or better yet, do this in your application and not in T-SQL as this is a presentation issue.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog
snufse
Constraint Violating Yak Guru
469 Posts
Posted - 2008-08-12 : 16:59:44
Hi tkizer,Good idea, I will do it my presentation program. Thank you.
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2008-08-14 : 06:22:07
quote:Originally posted by snufse Hi tkizer,Good idea, I will do it my presentation program. Thank you.
After a long time I'm seeing a person admitting to do formation at front end MadhivananFailing to plan is Planning to fail
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2008-08-14 : 06:23:53
quote:Originally posted by madhivanan
quote:Originally posted by snufse Hi tkizer,Good idea, I will do it my presentation program. Thank you.
After a long time I'm seeing a person admitting to do formation at front end MadhivananFailing to plan is Planning to fail