Need Help In Query:
-
Hi select CAST((datediff(day,createdon,getdate())/30) as float) Avg, from customers I want to give the result in Fraction is it possible? it is not showing the fraction result. createdon is the datetime field Any Help is appreciated. Regards Shahzad Aslam Software Engineer
-
Hi select CAST((datediff(day,createdon,getdate())/30) as float) Avg, from customers I want to give the result in Fraction is it possible? it is not showing the fraction result. createdon is the datetime field Any Help is appreciated. Regards Shahzad Aslam Software Engineer
datediff function's date part "day" returns difference in number of days i.e 1 / 2 / 3 ..... if u r looking for even part of day, get the difference in hours/minutes/ ... then try converting that to days so that you get the result as you are expecting
Regards KP