Click here to Skip to main content
15,886,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi guys i know this will probably be a easy question for some but i just cant seem to rap my head around it

i am getting a value from a query in the format "d:HH:mm:ss" but its a varchar value

now i need to get the average time from that column in SSRS

so some way i need to convert that to a datetime to get the average from it anyhelp would be nice
Posted

1 solution

google "t-sql convert var char to datetime" for more info, but basically, it goes something like this (your needs will most likely be different):

CONVERT(DATETIME, SUBSTRING(datefld,5,4)+SUBSTRING( datefld,1,4),112)
 
Share this answer
 
Comments
Unforgiv3n 24-Jan-11 1:51am    
there is no convert in SSRS ? or am i missing it completely?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900