|
-
Sep 6th, 2000, 06:36 AM
#1
Thread Starter
Lively Member
does anybody know a way to calculate the age of a record.
I am writing a call logging system, and as each call is recieved a field in the calls table is used to store the date and time ( using the vb NOW function )
What the system does at a later point is queries the database and gets all outstanding calls.
I then grab the oldest call, and I need to be able to say how old the call is in DAYS, HOURS and Minutes.
But I am not sure how to do this, is there a vb funstion to carry out the calculation?
IE:
Outstanding = NOW - OLDDATE
ANY IDEAS!!!
THE DOUGSTER!!!!!!
*-MCSD-*
-
Sep 6th, 2000, 06:59 AM
#2
_______
<?>
'will give you the days
'my var = your mdb field
myVar = "9/01/2000 7:40:08 AM"
MsgBox "Days from today: " & DateDiff("d", myVar, Now)
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 6th, 2000, 07:08 AM
#3
_______
<?>
Code:
Private Sub Form_Load()
Dim myvar As Date
'my var = your mdb field
myvar = "9/01/2000 7:40:08 AM"
Dim mHour As Double, mMin As Double, mSec As Double
mHour = DateDiff("h", myvar, Now)
mMin = DateDiff("m", myvar, Now)
mSec = DateDiff("s", myvar, Now)
Dim myTimeGone As String
myTimeGone = " Hours = " & mHour & ":" & " Minuites = " & mMin & ":" & " Seconds = " & mSec
MsgBox myTimeGone
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|