Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding time 1

Status
Not open for further replies.

tziviak

Technical User
Joined
Oct 10, 2002
Messages
128
Location
US
I have a time/date field in access and a text field for minutes
how do I add them both-using asp?
I tried:

var Total=Math.abs(oRs("TotalSessionDuration"))
var EndTime=oRs("TimeSessionStarted") + (Total*60*1000)

TimeSessionStarted-is the time field & TotalSessionDuration is the text field

I'd appreciate help-since I'm pretty much new to these things
Thank you
 
are you coding your apges in jscript?

if not might want to look into the DateAdd function _________________________________________________________
for the best results to your questions: FAQ333-2924
01001111 01101110 01110000 01101110 01110100
onpnt2.gif
[/sub]
 
>> oRs("TimeSessionStarted")
Fisrt, that returns a reference to a ADO.Field object so you can’t add anything to it.
oRs("TimeSessionStarted") + ( 10)
not going to work

Code:
var Total=Math.abs(oRs("TotalSessionDuration"));
var dt = new Date(oRs(“TimeSessionStarted));
var mills = dt.valueOf() + (Total*60*1000);
dt = new Date( mills);

does that help?
-pete

 
thanks -I used the DateAdd function-and it works great!
thanks for everyone's help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top