Friday, March 30, 2012

Help in crystalReorts8.5

Hi all,

How to get hours between two datetime ranges.
Actually i have to do (enddatetime-startdatetime) and it converts into hours
plz help meuse datediff function
datediff('h',startdatetime,enddatetime)

hope it helps you|||Thanks for your reply

But if i use datediff function as you suggested,getting hours

i mean i am getting round fig : 1 hour and 2 hours likethat
but i need if it contains 1 hr 30 mins need to get 1.30

but iam getting 1 hr instead of 1.30

do u have any idea abt that|||u can find minutes and divide by 60 u will get in hrs

datediff('n',sdate,edate)/60|||Thanks for ur reply
but small problem make in grand total

i get this values like that
1.12
1.12
1.12
---
3.35 (instead of 3.36)
i get this value
what is the problem in this|||1.12 is not actually 1 hr and 12 mins

since 124/60 is not rounded off thats tats y u r not getting correct sum.

u can use

datediff('h',datetime('1:20pm'),datetime('2:22pm'))&'Hr'& datediff('n',datetime('1:20pm'),datetime('2:22pm'))-datediff('h',datetime('1:20pm'),datetime('2:22pm'))*60 & 'Min'

which returns
1.00hr2.00min

but u cannot perform any sum on this as it is return string|||thanks for reply,

but i want grantotal of total hours
what can i do
is there any alternative
plz reply me|||Thanks for ur reply
but small problem make in grand total

i get this values like that
1.12
1.12
1.12
---
3.35 (instead of 3.36)
i get this value
what is the problem in this

Hi use this

val(cstr(datediff('n',cdatetime('1:28pm'),cdatetime('1.45pm'))/60))

hope it works for u

No comments:

Post a Comment