User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 401,695 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,710 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Views: 1770 | Replies: 3
Reply
Join Date: Sep 2005
Posts: 3
Reputation: maylim26 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
maylim26 maylim26 is offline Offline
Newbie Poster

Help How to counta repeat records

  #1  
Oct 8th, 2005
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2005
Location: Montreal, QC (Almost)
Posts: 130
Reputation: Yomet is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 9
Yomet Yomet is offline Offline
Junior Poster

Re: How to counta repeat records

  #2  
Nov 6th, 2005
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
Reply With Quote  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: How to counta repeat records

  #3  
Nov 6th, 2005
Assuming you are using a database program, and not something sick like flat files :eek:
Reply With Quote  
Join Date: Nov 2005
Location: Montreal, QC (Almost)
Posts: 130
Reputation: Yomet is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 9
Yomet Yomet is offline Offline
Junior Poster

Solution Re: How to counta repeat records

  #4  
Nov 6th, 2005
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 8:10 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC