473,320 Members | 2,117 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,320 software developers and data experts.

Calc time date difference in a report

I have a simple table the has First Name , Last Name, SSN, Date&Time.
I have a report that will show all this information but I would like to
put in at calculation to tell the difference between 2 Date&time stamps
for the person. The report shows Last name, First Name and Date&Tiem
Field. If the persone has 2 records I would like to show the amount of
time between each in put.

Nov 13 '05 #1
4 2616
Look at Access Help for explanation and syntax of the DateDiff function.
Create an unbound control on your report and make its control source:
=DateDiff([myFirstDate],[mySecondDate])

BTW, are you really entering and storing the Name & SSN for each record?
Why not have 2 related tables (1-Many):

tblClients
clientID -autonumber, primary key
LastName - text
FirstName
SSN
etc.

tblDates
DateID -autonumber, primary key
clientID - integer, foreign key
myDate - Date/Time

Once you establish referential integrity between these tables, and setup a
Main form with client data, and a subform with date records, you'll only
need to enter a date to create a related record. Use a query of those two
tables to supply your report.

-Ed
"qtip" <cf******@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have a simple table the has First Name , Last Name, SSN, Date&Time.
I have a report that will show all this information but I would like to
put in at calculation to tell the difference between 2 Date&time stamps
for the person. The report shows Last name, First Name and Date&Tiem
Field. If the persone has 2 records I would like to show the amount of
time between each in put.

Nov 13 '05 #2
I would do to tables but this needs to capture the Date& Time each time
a barcode (SSN) is swiped.

Nov 13 '05 #3
I have 2 tables

Table 1
LastName
FirstName
SSAN

Second Table
SSN-
SwipeTime- Date and Time of the swipe

A form that inputs the data into the second table. when you swipe the
badge it inputs the 9 digit SSN and inputs the Date & Time of the
swipe. I created a query and match Table 1 SSAN to Tables 2 SSN and
get an out put of the Name and times of the people who swipe there
card. I can run a report against the query and see the info but I
would like to calc the time between the first and second swipe. This is
not for payroll system but to track when people leave and come back to
an area. The problem I see is that if the swipe more then twice then
the report can't tell which is in and which is out.

Nov 13 '05 #4
Well, to run a good time clock app, you'll need to do a bit of error
checking, like handling people clocking out for lunch, then back in; people
working swing/night shifts that extend over multiple days, people working
double shifts, etc.

Unless you want the challenge of developing this from scratch, I'd recommend
searching for such applications and either buy them, or "borrow" some of
their techniques.
-Ed

"qtip" <cf******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have 2 tables

Table 1
LastName
FirstName
SSAN

Second Table
SSN-
SwipeTime- Date and Time of the swipe

A form that inputs the data into the second table. when you swipe the
badge it inputs the 9 digit SSN and inputs the Date & Time of the
swipe. I created a query and match Table 1 SSAN to Tables 2 SSN and
get an out put of the Name and times of the people who swipe there
card. I can run a report against the query and see the info but I
would like to calc the time between the first and second swipe. This is
not for payroll system but to track when people leave and come back to
an area. The problem I see is that if the swipe more then twice then
the report can't tell which is in and which is out.

Nov 13 '05 #5

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

Similar topics

9
by: tertius | last post by:
Hi, Is there a more pythonic way to write or do a date difference calculation? I have as input two date fields in the form 'YYYY-MM-DD' TIA Terius
0
by: Stewart Midwinter | last post by:
After an hour of research, I'm more confused than ever. I don't know if I should use the time module, or the eGenix datetime module. Here's what I want to do: I want to calculate the time...
3
by: Astra | last post by:
Hi All Wonder if you can help me with the following calc, which I want to create to check whether or not a user has entered a valid credit card expiry date: 1) I have retrieve a value from 2 x...
12
by: Susan Cranford | last post by:
Please forgive, I have looked at so much info I can't figure out how to put it together even though I know it must be fairly simple. I have an array of input text boxes (txtDOBn) where n is...
4
by: Mark Reed | last post by:
Hi all, I have a query (query1) which shows scan date, scan time & operator. One scan = 1 record. What I want to do is create a report based on query 2 from query1 which shows all the scans AND...
2
by: Viviana R via AccessMonster.com | last post by:
I'm tryin to calculate de difference of time between different records and fields. I have a Report with date, time In, and Time Out fields. EX: Date Time IN Time Out 4/12/05 12:10...
0
by: Rahul Chatterjee | last post by:
Hello All I have designed a dotnet application using VB which basically takes a selection and passes value to a crystal report which in turn passes the value to a Stored procedure. After the...
1
by: Susan Bricker | last post by:
Greetings. I have a report (actually all of my reports in an MDB) that I want to date/time stamp at the bottom. Previously, I had used the builtin function of Now(). I thought that would give...
9
by: Ross | last post by:
I'm a newbie at this, and have searched a lot but can't find something that seems appropriate for measuring a recurring elapsed time. Creating an object with: var mydate = new Date(); seems...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.