Calculate time in Access 2008

R

r wil

the following code works in access 97 but does not work in access 2008. i'm trying to alleaviate the negative values going from pm to am. and decimals

TotT: IIf([testing].[time out]>[testing].[time in],(([testing].[time out]-[testing].[time in])*24)*60,1440-(([testing].[time in]-[testing].[time out])*24)*60)

EggHeadCafe - Software Developer Portal of Choice
..NET Managing more than one connection string from Web.config
http://www.eggheadcafe.com/tutorial...d0-48d4f23f78ca/net-managing-more-than-o.aspx
 
M

MGFoster

r said:
the following code works in access 97 but does not work in access 2008. i'm trying to alleaviate the negative values going from pm to am. and decimals

TotT: IIf([testing].[time out]>[testing].[time in],(([testing].[time out]-[testing].[time in])*24)*60,1440-(([testing].[time in]-[testing].[time out])*24)*60)

EggHeadCafe - Software Developer Portal of Choice
.NET Managing more than one connection string from Web.config
http://www.eggheadcafe.com/tutorial...d0-48d4f23f78ca/net-managing-more-than-o.aspx

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Try using the DateDiff function. It wud help if you had the date as
part of the time-in & time-out.

lngMinutesWorked = DateDiff("n", [time in], [time out])

If the worker worked a shift from 11pm to 7am the function would break
out like this:

lngWorked = DateDiff("n", #10/19/09 23:00#, #10/20/09 07:00#)

Which yields 480 minutes.

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSt0hs4echKqOuFEgEQKBCACgxT7tKchYQCNfjaQ1/c90F7Ui9cMAoK3y
j1cWBXtvsdTLG9Fe3zwbgzjO
=E7p0
-----END PGP SIGNATURE-----
 

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