Hi. I'm trying to use the following wee function to calculate the number of hours from a smalldatetime value in my recordset and the current date/time (Now()). I'm using ASP VBScript.
I was recommended the following function:
<%
timeStart = "2009/10/10 12:14:00"
Response.Write(datediff("h", timeStart, Now()))
%>
How do I change the static date value to one from my recordset?
I've tried adding in the code like this:
<%
timeStart = "(rsLATESTREVIEWS.Fields.Item("mgreviewdate").Value)"
Response.Write(datediff("h", timeStart, Now()))
%>
I also tried this:
<%
timeStart = "(rsLATESTREVIEWS.Fields.Item(" & " mgreviewdate " & ").Value)"
Response.Write(datediff("h", timeStart, Now()))
%>
...but I'm getting lots of "Expected end of statement" errors with both.
Would appreciate any advice. Thanks.
Regards
Nath.