If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Time Calc
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 |
#2
|
|||
|
|||
Time Calc
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 '================================================= === DS wrote: 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 |
#3
|
|||
|
|||
Time Calc
Thanks John, I see what you mean about the Null. Any Suggestions.
Thanks DS "John Spencer" wrote in message ... 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 '================================================= === DS wrote: 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 |
#4
|
|||
|
|||
Time Calc
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 '================================================= === DS wrote: Thanks John, I see what you mean about the Null. Any Suggestions. Thanks DS "John Spencer" wrote in message ... 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 '================================================= === DS wrote: 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 |
Thread Tools | |
Display Modes | |
|
|