954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to counta repeat records

i m develop a system related car in/out records. I got data fields like date, time in, time out, car numbers......
My problem is How to count the repeat records base on repeat car numbers on a certain date?( my purpose is count how many times a car in/out on a certain date) :?: :?:
i hope anyone here can understand my problems and pls help me

maylim26
Newbie Poster
3 posts since Sep 2005
Reputation Points: 10
Solved Threads: 0
 

If I understand your problem correctly you want to know how many times a certain car was in/out on a certain date. Is that correct?

If so, you can issue the following query:

SELECT Table.Date, Table.car, Count(Table.car) AS CountOfcar
FROM Table
GROUP BY Table.Date, Table.car;

This will give you a dataset that has the date, the car number and how many time that car appears during that date. If you need to restrict the records further, for example only those that have both in and out times or for a specific date range, just add a WHERE clause to restrict the data.

Hope this helps

Yomet

Yomet
Junior Poster
134 posts since Nov 2005
Reputation Points: 16
Solved Threads: 10
 

Assuming you are using a database program, and not something sick like flat files :eek:

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

Listen to Comatose - he's totally correct.

I made the unsaid assumption that you are using some kind of SQL compliant database as your back end - otherwise you'll have to find another way of doing this.

Thank you Comatose for setting me straight... ;)

I'll do my best not to make unsaid assumptions again... :)

Yomet

Yomet
Junior Poster
134 posts since Nov 2005
Reputation Points: 16
Solved Threads: 10
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You