Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I need to find out how I can multiply a number of hours by expected personnel, to get total hours booked to event. the calculation to get the Hours are
if(interval(EndTime - StartTime,'hh:mm')<0, interval(Date(EndTime,'ddmmyy')+1 - StartTime,'hh:mm'),interval(EndTime - StartTime,'hh:mm') )as [Total_Hours] and the personnel Expected is a sum of numbers. so the total booked hours should be 21:00, but I cant workout how I can calculate a time calculation by a number calculation. am i missing something
can anyone help.
thanks in advance
Could you post your sample qvw?
First, you have too many formatting functions in your expression. Remove them: They do not change the calculations; they just prevent you from seeing the structure of your expression. Instead of
If( interval(EndTime - StartTime,'hh:mm')<0,
interval(Date(EndTime,'ddmmyy')+1 - StartTime,'hh:mm'),
interval(EndTime - StartTime,'hh:mm')
) as [Total_Hours]
you should write
Interval(
If( EndTime - StartTime <0,
EndTime +1 - StartTime,
EndTime - StartTime ),
'hh:mm' ) as [Total_Hours]
If you want to format it, you should put the formatting function as the outermost function.
Secondly, if EndTime and StartTime are correctly interpreted, they have numeric values where a difference of one day is 1, and a difference of one hour is 1/24. This means that you can get the number of hours through
(EndTime - StartTime) * 24
HIC
Hi tresesco
I have attached an example now.
thanks
user id, password?
Can you share the credentials to login to your application?
I was trying open your sample document but it was asking the user ID
try with below
Expected hours = Personel expected*(Totalhours*24)
In total hours you can use your actual expression
Hi sorry about that i forgot it had section access. i have remove this now and re-uploaded
thanks in advance
I tried and it worked
DDT_Hours*24)*[Personnel Expected]
Hi Jebamalai
thanks for taking a look,i need the output to be formated to hh:mm. can you help?
regards
James