2

I have two fields with Edm.DateTime type. How can I get just Time in h:mm format and concat them in CommandText of EntityDataSource: "01/02/2013 3:15 AM and 01/02/2013 4:15 AM" should be "15:15-16:15" I found cast for concat, Is it right solution:

CommandText="SELECT  CAST([DoctorAppointment].[Start] AS System.String) + '--'+ CAST([DoctorAppointment].[End] AS System.String) 
         as Name FROM  DatabaseEntities.DoctorAppointments as DoctorAppointment"
  • I solved problem right now by this but I am not sure: CAST(Hour(CAST([DoctorAppointment].[Start] AS System.DateTime))AS System.String)+':'+ CAST(Minute(CAST([DoctorAppointment].[Start] AS System.DateTime)) AS System.String) + '-' + CAST(Hour(CAST([DoctorAppointment].[End] AS System.DateTime)) AS System.String)+':'+ CAST(Minute(CAST([DoctorAppointment].[End] AS System.DateTime)) AS System.String) – user1020565 Apr 04 '13 at 05:49

1 Answers1

0
Select="String.Format(it.[interview_start_date], 'dd/ MM/ YYYY') as Display,

This works for me.

gvlasov
  • 18,638
  • 21
  • 74
  • 110
Ahmed
  • 25
  • 8