473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Subtract one datetime from another

Hi all,

need to subtract one date from another to show how long a user was logger in
for.

i.e.

<%=(rsDriverLogin.Fields.Item("OFF_DATE").Value) %> minus
<%=(rsDriverLogin.Fields.Item("ON_DATE").Value)% >

The values in the sql OFF_DATE and ON_DATE fields are stored as

13/06/2006 19:01:28

Can either be done on the ASP page or in the db itself, doesn't matter
which.

Regards
Simon
Jun 19 '06 #1
2 2655
Take a look at DateDiff()


"Simon Gare" <sg@simongare.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Hi all,

need to subtract one date from another to show how long a user was logger
in
for.

i.e.

<%=(rsDriverLogin.Fields.Item("OFF_DATE").Value) %> minus
<%=(rsDriverLogin.Fields.Item("ON_DATE").Value)% >

The values in the sql OFF_DATE and ON_DATE fields are stored as

13/06/2006 19:01:28

Can either be done on the ASP page or in the db itself, doesn't matter
which.

Regards
Simon

Jun 19 '06 #2

http://www.powerasp.com/content/new/...ference-19.htm

"Simon Gare" <sg@simongare.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Hi all,

need to subtract one date from another to show how long a user was logger
in
for.

i.e.

<%=(rsDriverLogin.Fields.Item("OFF_DATE").Value) %> minus
<%=(rsDriverLogin.Fields.Item("ON_DATE").Value)% >

The values in the sql OFF_DATE and ON_DATE fields are stored as

13/06/2006 19:01:28

Can either be done on the ASP page or in the db itself, doesn't matter
which.

Regards
Simon

Jun 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jimbo | last post by:
Anyone know how I can subtract 12 months from the current date?
4
by: Lee | last post by:
Hi All, I have a datetime field and want to subtract 24 (or any other number of) hours from it. How would I go about this? Thanks Lee
2
by: Martin Ho | last post by:
I have a small application which is running every x minutes and I need to display remaining time on the screen in this format (example): "Next start will be in: 00:13:25" , and it should...
5
by: Sandy | last post by:
Hello I need to subtract a pm time from an am time, e.g. 10:00 a.m. from 1:00 p.m. to get 3 I have two textboxes for the time values and next to each is a dropdownlist to click indicating a.m....
4
by: Gabe Matteson | last post by:
I want to be able to find out the names of files that have not been accessed in the past X days... i allow the user to put in the number of days, e.g. show all files that have no been accessed...
8
by: Remington | last post by:
I am using windows 2000pro with access 2000. I am trying to make a database for our HR department, that would allow our HR Director to type in an employee's ID number into a form and then select...
2
by: deepbright | last post by:
I'm having trouble understanding the MySQL docs on how to subtract two DATETIME values. I have two tables that have a DATETIME column. In my SELECT I am doing a JOIN to bring in both sets of rows....
2
by: barronmo | last post by:
I'm trying to get the difference in dates using the time module rather than datetime because I need to use strptime() to convert a date and then find out how many weeks and days until that date. ...
2
by: JonDavid | last post by:
CODE: DateTime coursestatusdate = DateTime.MinValue; if (courseRow.ToString() != string.Empty) { coursestatusdate = DateTime.Parse(courseRow ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.