skgupta
9th February 2011, 14:02
I am new in LN6 and going to make one customization for MTTR in Service module, I have two dates in tsclm100 table, tsclm100.pect and tsclm100.pfct. I want the difference of both files in hours.
Pls provide the syntax
Thanks in advance
kiran kumar
10th February 2011, 10:55
Hi gupta,
First check that the domains of the above mentioned dates is same.If the domain of the both is not in UTC format then you can write
(tsclm100.pect-tsclm100.pfct)// to find the difference of dates
if both are in UTC format then use the function "utc.to.date" and get year,month,date,hours,minutes and seconds in different programmable variables as per the syntax and try to do operations with that.
All the best.
lbencic
10th February 2011, 21:12
If you subtract the UTC dates, you will get the difference in seconds. Divide by 60 to get the difference in minutes. Divide by 60 again to get the difference in hours... syntax depends on how you want to store the decimals...
skgupta
11th February 2011, 10:10
Boths dates domain are tsmdm.utct in table.
I have taken domain tfgld.date for sdat (Start Date),fdat (Finish Date) and write function as below to get output in days. but I want difference in only number of hours (like I start on Call at 7th Feb 2011 at 20:00:00 and finished that Call at 8th Feb 2011 at 04:00:00) the output will be 8 hours downtime of this call.
pls help.............
function get.sdat.date()
{
domain tcmcs.long yno1, mno1, dno1, hrs1, mts1, scd1
long temp.var2
temp.var2 = utc.to.date(tsclm100.pect, yno1, mno1, dno1, hrs1, mts1, scd1)
sdat = date.to.num(yno1, mno1, dno1)
}
function get.fdat.date()
{
domain tcmcs.long yno2, mno2, dno2, hrs2, mts2, scd2
long temp.var2
temp.var2 = utc.to.date(tsclm100.pfct, yno2, mno2, dno2, hrs2, mts2, scd2)
fdat = date.to.num(yno2, mno2, dno2)
}
norwim
11th February 2011, 13:36
Hi there,
as mentioned above:
The difference (fdat-sdat) is in seconds, so dividing by 3600 gives hours.
hth
Norbert
skgupta
12th February 2011, 08:17
thanks
job done