I've lifted the following code from a thread here DateDiff in days, hours and mins
but I'm getting a syntax error on the first line of code and I can't work out why because it looks the same as other function syntax I've written that works fine.
Function TimeSpan(dt1, dt2)
seconds = Abs(DateDiff("S",dt1, dt2))
minutes = seconds \ 60
hours = minutes \ 60
minutes = minutes mod 60
seconds = seconds mod 60
if len(hours) = 1 then hours = "0" & hours
TimeSpan = hours & ":" & _
RIGHT("00" & minutes, 2) & ":" & _
RIGHT("00" & seconds, 2)
End Function
dt1 = ActiveRequest.Fields("CreationDate").Value
dt2 = ActiveRequest.Fields("1stcontactdatetime").Value
The error I receive is: "Error in control script at line 1: Syntax error (Microsoft VBScript compilation error): FuntionTimeSpan(dt1, dt2)"
Any advice would be greatly appreciated, especially if it helps me not do it again!
code MsgBox(ScriptEngine) MsgBox(ScriptEngineBuildVersion) MsgBox(ScriptEngineMajorVersion) MsgBox(ScriptEngineMinorVersion) codeI received the following VBScript, 17280, 5, 8 I believe it works with Windows Scripting HostTimeSpan?