Time Calc

D

DS

I have this formula to get Elapsed Time...it works fine except I have an
additional problem. My Date and Time are two seperate fields for reasons to
deep to go into. Should I or can I combine the two fields LogDateIn &
LogTimeIn to make this work or is there another way.

=DateDiff("n",[LogTimeIn],[LogTimeOut])

The fields are...

LogDateIn
LogTimeIn
LogDateOut
LogTimeOut

Thanks
DS
 
J

John Spencer

You should be able to add the two together

LogDateIn + LogTImeIn to get a value that is the date and time together.

The only problem will be if one of the two is Null (blank) then you will
get a null value for the calculated combination.

So the following should be perfectly valid and return the number of
minutes between LogIn and LogOut.


=DateDiff("n", LogdateIn + logTimeIN,LogDateOut + LogTimeOut)

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
D

DS

Thanks John, I see what you mean about the Null. Any Suggestions.
Thanks
DS
John Spencer said:
You should be able to add the two together

LogDateIn + LogTImeIn to get a value that is the date and time together.

The only problem will be if one of the two is Null (blank) then you will
get a null value for the calculated combination.

So the following should be perfectly valid and return the number of
minutes between LogIn and LogOut.


=DateDiff("n", LogdateIn + logTimeIN,LogDateOut + LogTimeOut)

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I have this formula to get Elapsed Time...it works fine except I have an
additional problem. My Date and Time are two seperate fields for reasons
to deep to go into. Should I or can I combine the two fields LogDateIn &
LogTimeIn to make this work or is there another way.

=DateDiff("n",[LogTimeIn],[LogTimeOut])

The fields are...

LogDateIn
LogTimeIn
LogDateOut
LogTimeOut

Thanks
DS
 
J

John Spencer

It is easy to handle this for the time fields

Nz(LogTimeIn,0) will return midnight

Handling null dates depends on what you want to do. You can use Nz to
return the zero date - December 10, 1899 or you can return some other date.

=DateDiff("n",Nz(LogDateIn,LogDateOout) + Nz(LogTimeIn,0),
Nz(LogDateOut,LogDateIn) + Nz(LogTimeOut,0))


That will give you a numeric result as long as LogDateIn or LogDateOut
has a value other than null. It may not give you a desired result.

You have to decide what rule(s) you want to apply to handle null values.

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

Thanks John, I see what you mean about the Null. Any Suggestions.
Thanks
DS
John Spencer said:
You should be able to add the two together

LogDateIn + LogTImeIn to get a value that is the date and time together.

The only problem will be if one of the two is Null (blank) then you will
get a null value for the calculated combination.

So the following should be perfectly valid and return the number of
minutes between LogIn and LogOut.


=DateDiff("n", LogdateIn + logTimeIN,LogDateOut + LogTimeOut)

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I have this formula to get Elapsed Time...it works fine except I have an
additional problem. My Date and Time are two seperate fields for reasons
to deep to go into. Should I or can I combine the two fields LogDateIn &
LogTimeIn to make this work or is there another way.

=DateDiff("n",[LogTimeIn],[LogTimeOut])

The fields are...

LogDateIn
LogTimeIn
LogDateOut
LogTimeOut

Thanks
DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top