Monday, January 2, 2012

Time Sorting if AM and PM Charaters are Exist

select data,data_id from master_data where master_id = 9 and active = 1
orderby(substring(data,charindex('',data)+1,len(data))),data

Output :

07-12 AM     
09-10 AM     
01-03 PM     
03-05 PM    
05-07 PM   

No comments:

Post a Comment