473,471 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Ignore Duplicate Entries

Hello,

I am using Access 2002.

I have read through 20 plus posts on here and I am still having
trouble.

My table consists of the following fields:

Date Client ID

I need to search by a date range to determine the total number of
clients served. Some clients come in more than once a day. So when I
do a count it returns more clients than actually served.

I need to know how many clients were served by date range.

Example

Date Client ID
1/1/07 001
1/1/07 001
1/4/07 002

The return I get for the date range of 1/1/07-1/31/07 is 3, but I only
served 2 clients.

Any help would be greatly appreciated! I am able to use either a
report or query for this information, whichever is easier to create.

Thank-you

Mar 10 '07 #1
8 4761
On Mar 10, 2:39 pm, "sixdeuce62" <sixdeuc...@gmail.comwrote:
Hello,

I am using Access 2002.

I have read through 20 plus posts on here and I am still having
trouble.

My table consists of the following fields:

Date Client ID

I need to search by a date range to determine the total number of
clients served. Some clients come in more than once a day. So when I
do a count it returns more clients than actually served.

I need to know how many clients were served by date range.

Example

Date Client ID
1/1/07 001
1/1/07 001
1/4/07 002

The return I get for the date range of 1/1/07-1/31/07 is 3, but I only
served 2 clients.

Any help would be greatly appreciated! I am able to use either a
report or query for this information, whichever is easier to create.

Thank-you

It probably depends on how much info you're really after as to how
easy the query will be. If you group on Client ID, set Date criteria
as Between x And Y and use the DISTINCT predicate - you should get 2
records returned. A report could be made based on the query.

P.S. - Date is a really bad name for a database object (field, table
form etc.). There is a function by that name and the DB could get
confused as to which you mean.

SELECT DISTINCT Table1.[Client ID]
FROM Table1
GROUP BY Table1.[Client ID], Table1.[Date]
HAVING (((Table1.[Date]) Between #1/1/2007# And #1/4/2007#));

Mar 10 '07 #2
Hello,

Thank you for the quick reply. My table is called Program Information

This is what I exactly entered from your suggestion.

SELECT DISTINCT Program Information.[Client ID]
FROM Program Information
GROUP BYProgram Information.[Client ID], Program Information.[Date]
HAVING (((Program Information.[Date]) Between #1/1/2007# And
#1/4/2007#));
This is what I got when I tried to save the query:

Synax Error (missing operator) in query expression 'Program
Information. [Client ID]'.
Would it be easier to do this in a report? I just need a total number
of clients served per month, any way I can get it. (Besides manually
counting them)

I gave a query that gives me the date and client id my date range. It
just gives me every time someone came in, which duplicates clients
id's on the same day. Is there a way to count the user id field in a
report that does not duplicate user id's in the total?

Thanks


On Mar 10, 3:59 pm, "storrboy" <storr...@sympatico.cawrote:
On Mar 10, 2:39 pm, "sixdeuce62" <sixdeuc...@gmail.comwrote:


Hello,
I am using Access 2002.
I have read through 20 plus posts on here and I am still having
trouble.
My table consists of the following fields:
Date Client ID
I need to search by a date range to determine the total number of
clients served. Some clients come in more than once a day. So when I
do a count it returns more clients than actually served.
I need to know how many clients were served by date range.
Example
Date Client ID
1/1/07 001
1/1/07 001
1/4/07 002
The return I get for the date range of 1/1/07-1/31/07 is 3, but I only
served 2 clients.
Any help would be greatly appreciated! I am able to use either a
report or query for this information, whichever is easier to create.
Thank-you

It probably depends on how much info you're really after as to how
easy the query will be. If you group on Client ID, set Date criteria
as Between x And Y and use the DISTINCT predicate - you should get 2
records returned. A report could be made based on the query.

P.S. - Date is a really bad name for a database object (field, table
form etc.). There is a function by that name and the DB could get
confused as to which you mean.

SELECT DISTINCT Table1.[Client ID]
FROM Table1
GROUP BY Table1.[Client ID], Table1.[Date]
HAVING (((Table1.[Date]) Between #1/1/2007# And #1/4/2007#));- Hide quoted text -

- Show quoted text -

Mar 10 '07 #3

A report needs a query to display what you want, so either way you
need to make one or know how to get the report do what you want.
I see a few things wrong with your attempt.

1) Fields with spaces, non-alphanumeric characters or potentially
named like a system reserved word require [ ] around them
2) There is no space between GROUP BY and Program Information

Try this revised query. You may need to play with spacing between
words if you are cutting and pasting. Trailing or starting spaces may
get removed.

SELECT DISTINCT [Program Information].[Client ID]
FROM [Program Information]
GROUP BY [Program Information].[Client ID], [Program Information].
[Date]
HAVING ((([Program Information].[Date]) Between #1/1/2007# And
#1/4/2007#));

Mar 10 '07 #4
Hello,

Thanks again. Well we are getting closer. Now the query returns the
unique client id's. I do have one issue though. When I run the query I
get a box that pops up.

The box says:

Enter Parameter Value
Program.Information.Date
I have to enter the last date of the month to get the query to finish
running.

I would like to have an Enter Parameter Value box come up and prompt
me for Beginning Date and Ending Date.

Thanks for all the help so far, you're a lifesaver!
This is what I entered from your recommendations:

SELECT DISTINCT [Program Information].[Client ID]
FROM [Program Information]
GROUP BY [Program Information].[Client ID], [Program Information].Date
HAVING ((([Program Information].Date) Between #3/1/2007# And
#3/31/2007#));
The records I am using are actually from this month, 3/2007.

On Mar 10, 6:50 pm, "storrboy" <storr...@sympatico.cawrote:
A report needs a query to display what you want, so either way you
need to make one or know how to get the report do what you want.
I see a few things wrong with your attempt.

1) Fields with spaces, non-alphanumeric characters or potentially
named like a system reserved word require [ ] around them
2) There is no space between GROUP BY and Program Information

Try this revised query. You may need to play with spacing between
words if you are cutting and pasting. Trailing or starting spaces may
get removed.

SELECT DISTINCT [Program Information].[Client ID]
FROM [Program Information]
GROUP BY [Program Information].[Client ID], [Program Information].
[Date]
HAVING ((([Program Information].[Date]) Between #1/1/2007# And
#1/4/2007#));

Mar 11 '07 #5

Remember this snippet?
>P.S. - Date is a really bad name for a database object (field, table
form etc.). There is a function by that name and the DB could get
confused as to which you mean.
The compiler is expecting to find an object called
Program.Information.Date
The dots indicate it expects an object or a function. It's confused.
"Do you mean the function or a field? Hell I've got a query to run so
I'll just ask where the blinking value of the function is. Let them
figure it out...."

If you can afford to, I'd reccomend renaming the Date field to
somethig else like pfDate or Client_Date or something.
Otherwise you can try to replace the [ ] around the word Date in your
query, but it may still be flakey.

Mar 11 '07 #6
Hello,

Would Date In work? Do I just change the Date to Date In within the
expression?

Thanks again
On Mar 10, 9:50 pm, "storrboy" <storr...@sympatico.cawrote:
Remember this snippet?
P.S. - Date is a really bad name for a database object (field, table
form etc.). There is a function by that name and the DB could get
confused as to which you mean.

The compiler is expecting to find an object called
Program.Information.Date
The dots indicate it expects an object or a function. It's confused.
"Do you mean the function or a field? Hell I've got a query to run so
I'll just ask where the blinking value of the function is. Let them
figure it out...."

If you can afford to, I'd reccomend renaming the Date field to
somethig else like pfDate or Client_Date or something.
Otherwise you can try to replace the [ ] around the word Date in your
query, but it may still be flakey.

Mar 11 '07 #7
On Mar 10, 9:50 pm, "sixdeuce62" <sixdeuc...@gmail.comwrote:
Hello,

Would Date In work? Do I just change the Date to Date In within the
expression?

Thanks again
[Date In] should work. But not if the field itself is still named
[Date]. These are the options. (remember the Date field name needs to
look the same in all occurances of it, not just this line...

As is...
GROUP BY [Program Information].[Client ID], [Program Information].
[Date]

Rename the field in table Date In
GROUP BY [Program Information].[Client ID], [Program Information].
[Date In]
BE CAREFUL. Other forms, queries, reports, other front-ends or
connecting DBs may rely on this field being named Date. Unless you
know changing it will NOT affect anything else, do not change it
without carefully examining the effects and always make a back-up.

Mar 11 '07 #8
storrboy,

Thank you so much. That did it! It works now! I really appreciate all
your help. Thanks for sharing your knowledge.

sixdeuce62

On Mar 10, 11:11 pm, "storrboy" <storr...@sympatico.cawrote:
On Mar 10, 9:50 pm, "sixdeuce62" <sixdeuc...@gmail.comwrote:
Hello,
Would Date In work? Do I just change the Date to Date In within the
expression?
Thanks again

[Date In] should work. But not if the field itself is still named
[Date]. These are the options. (remember the Date field name needs to
look the same in all occurances of it, not just this line...

As is...
GROUP BY [Program Information].[Client ID], [Program Information].
[Date]

Rename the field in table Date In
GROUP BY [Program Information].[Client ID], [Program Information].
[Date In]

BE CAREFUL. Other forms, queries, reports, other front-ends or
connecting DBs may rely on this field being named Date. Unless you
know changing it will NOT affect anything else, do not change it
without carefully examining the effects and always make a back-up.

Mar 11 '07 #9

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

Similar topics

0
by: Gary Lundquest | last post by:
I have an application with MS Access 2000 as the front end and MySQL as the back end. All was well until I upgraded the MySQL (Linux) server. The Problem: I insert data into a cumulative table....
1
by: Gary Lundquest | last post by:
It appears to me that MySQL version 4 returns an error messge when doing an Insert that results in duplicate entries. Version 3 did NOT return an error - it dropped the duplicate entries and ran...
1
by: marx | last post by:
I have a bit of a problem and any help would be much appreciated. Problem: I have two dropdown list boxes with same data(all data driven). These are used for two separate entries. For every...
3
by: andreas.maurer1971 | last post by:
Hi all, since a few years I use the following statement to find duplicate entries in a table: SELECT t1.id, t2.id,... FROM table AS t1 INNER JOIN table AS t2 ON t1.field = t2.field WHERE...
5
by: Chris Lasher | last post by:
Hello Pythonistas! I'm looking for a way to duplicate entries in a symmetrical matrix that's composed of genetic distances. For example, suppose I have a matrix like the following: A B ...
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
6
by: teser3 | last post by:
I have my PHP inserting into Oracle 9i. But how do I prevent duplicate record entries? I only have 3 fields in the insert in the action page: CODE <?php $c=OCILogon("scott", "tiger",...
4
by: ramdil | last post by:
Hi All I have table and it have around 90000 records.Its primary key is autonumber field and it has also have date column and name, then some other columns Now i have problem with the table,as my...
7
by: php_mysql_beginer911 | last post by:
Hi .. i am trying to update a table where if field contents any duplictaed entries than one of the field should be updated with random number which is unique so i can make all entries unique i...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.