473,385 Members | 1,622 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,385 software developers and data experts.

time function access2000

Hi,
i'am working at a project in an ac2000 enviroment. I need a function to
calculate the difference between startt and end-time. I want the reuslt in
the followed format " d "days and " hh " hours" and "nn" minutes
I the difference is smaller than 24 hours, the format should be "" hh "
hours" and "nn" minutes
If the endtime is not known, i want the difference between the time of begin
and now(().
the format of the end and begin-time = dd-mm-yyyy hh:nn (european notation)

I've already tried with the function datediff, bu i can't figure it out. The
end time can sometimes been in another month ,
I thougt it was rather easy tocalculate the difference, but it is not. It's
quite the opposite. A little help, wil be appreciated.
I will use the function(fTimeElapsed) in mine query in the field
"Timedifence: fTimeElapsed(endtime, begintime)"
thanks alfred

many, many thanks alfred
Mar 29 '06 #1
2 1475
You will need to code your own function to handle the nulls and suppress the
unnecessary periods, but Doug Steele has a more complete DateDiff() function
you can use as a start here:
http://www.accessmvp.com/djsteele/Diff2Dates.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Alfred" <fr**@kolkoe.ru> wrote in message
news:44***********************@news.skynet.be...
Hi,
i'am working at a project in an ac2000 enviroment. I need a function to
calculate the difference between startt and end-time. I want the reuslt in
the followed format " d "days and " hh " hours" and "nn" minutes
I the difference is smaller than 24 hours, the format should be "" hh "
hours" and "nn" minutes
If the endtime is not known, i want the difference between the time of
begin and now(().
the format of the end and begin-time = dd-mm-yyyy hh:nn (european
notation)

I've already tried with the function datediff, bu i can't figure it out.
The end time can sometimes been in another month ,
I thougt it was rather easy tocalculate the difference, but it is not.
It's quite the opposite. A little help, wil be appreciated.
I will use the function(fTimeElapsed) in mine query in the field
"Timedifence: fTimeElapsed(endtime, begintime)"
thanks alfred

Mar 29 '06 #2
"Alfred" <fr**@kolkoe.ru> wrote in
news:44***********************@news.skynet.be:
Hi,
i'am working at a project in an ac2000 enviroment. I need a
function to calculate the difference between startt and
end-time. I want the reuslt in the followed format " d "days
and " hh " hours" and "nn" minutes I the difference is smaller
than 24 hours, the format should be "" hh " hours" and "nn"
minutes If the endtime is not known, i want the difference
between the time of begin and now(().
the format of the end and begin-time = dd-mm-yyyy hh:nn
(european notation)

I've already tried with the function datediff, bu i can't
figure it out. The end time can sometimes been in another
month , I thougt it was rather easy tocalculate the
difference, but it is not. It's quite the opposite. A little
help, wil be appreciated. I will use the
function(fTimeElapsed) in mine query in the field
"Timedifence: fTimeElapsed(endtime, begintime)" thanks alfred

many, many thanks alfred

Do a google search for the Sec2Dur() function I posted here for
formatting, then simply do a
datediff("s", starttime, nz(endtime,now())

You'll need ot modify it to split out the days, and hide the
seconds as it now reports only hours:minutes:seconds. It does
however properly handle time across months and even a year or
two.
--
Bob Quintal

PA is y I've altered my email address.
Mar 29 '06 #3

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

Similar topics

2
by: jason | last post by:
Is there a specific path I can follow to upsize my access 2000 database which has: 20 tables - mixture of primary and foreign tables 20 queries (action, select etc) Built on top of this...
3
by: jason | last post by:
I need to deposit and empty dummy value into a date/time field within Access using INSERT. However, I pick up a data type error if I attempt to insert a NULL value for this particular date time...
7
by: aa | last post by:
I have beem recommended to use the Nz() function in the ORDER BY part of an Access2000 stored query. The query runs correcly from within Access2000 Yet when ran from ASP, it causes an error: ...
3
by: Roel Castro | last post by:
Hello everyone, Could somebody help me how to open time/date item in Control panel by codes in access form modules? Taking in consideration the operating system which is Windows 98, Windows 2000...
6
by: Rafi Kfir | last post by:
HI, I use vb6 to access database. I can select between "local" data base and "remote" data base. Both connection calls the same Access 2000 Mdb. The Mdb contains local tables (on the hard...
1
by: Mario Crevits | last post by:
My name is Mario Crevits, I'm from Belgium (Roeselare) and I'm working with Access97 for several years now. We are in an Access97-2000 migration project. I'm writing a wizard for the end-users to...
0
by: rc | last post by:
Moved a working MS Access application from Win2000 (version 5.0 SP 3) OS with MS Access 2000 and DB2 Run-time client v7.1 FP 4 to XP (version 5.1, SP 2) OS with MS Access 2003 and DB2 Run-time...
1
by: rc | last post by:
Running an Access2000 application in Access 2003 and getting the 3231 run-time error. This application has all linked tables some of which are Access and the rest are DB2. In the environment of...
6
by: alanpike | last post by:
Using SendObject in an Access2000 macro, I can send a report as an email attachment to MS Outlook. I would like the capability to have the person reading the attached email report to somehow...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.