472,993 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

Duplicate values

Hello, there,
I have a table tblData which has pharmacy data. The table has
following fields:
ClaimNum, LineNum...

The ClaimNum has claim number which is 12 characters. LineNum is NULL.
The table looks like this
ClaimNum LineNum
abcde1234561
abcde1234561
abcde1234562
abcde1234563
abced1234564
abcde1234564
abcde1234564
abcde1234564
abcde1234564
abcde1234565

The thing is that I have some duplicate ClaimNum, which is
understandable because some claims may have mutiple lines. I would
like to update the [LineNum] to 1 if the ClaimNum is not duplicate, to
2 if it is the second duplicate, to 3 if it is the third duplicate...
So, the combination of ClaimNum and LineNum could serve as Primary
key.

so the table would look like
ClaimNum LineNum
abcde1234561 1
abcde1234561 2
abcde1234562 1
abcde1234563 1
abcde1234564 1
abcde1234564 2
abcde1234564 3
abcde1234564 4
abcde1234564 5
abcde1234565 1
Thanks a lot in advance.
Pablo
Nov 12 '05 #1
2 1895
I may be wrong, but shouldn't you be using 2 tables, 1 for the ClaimNum
which would only need to be entered once, and thus avoid typing mistakes and
1 table for the line numbers. I am guessing that they hold more information
than just a number, possibly drug names.
entry would be via a form and subform
the linenumber would be incremented BeforeInsert of something in the subform

HTH

Phil
"Pablo" <pa*****@hispavista.com> wrote in message
news:e9**************************@posting.google.c om...
Hello, there,
I have a table tblData which has pharmacy data. The table has
following fields:
ClaimNum, LineNum...

The ClaimNum has claim number which is 12 characters. LineNum is NULL.
The table looks like this
ClaimNum LineNum
abcde1234561
abcde1234561
abcde1234562
abcde1234563
abced1234564
abcde1234564
abcde1234564
abcde1234564
abcde1234564
abcde1234565

The thing is that I have some duplicate ClaimNum, which is
understandable because some claims may have mutiple lines. I would
like to update the [LineNum] to 1 if the ClaimNum is not duplicate, to
2 if it is the second duplicate, to 3 if it is the third duplicate...
So, the combination of ClaimNum and LineNum could serve as Primary
key.

so the table would look like
ClaimNum LineNum
abcde1234561 1
abcde1234561 2
abcde1234562 1
abcde1234563 1
abcde1234564 1
abcde1234564 2
abcde1234564 3
abcde1234564 4
abcde1234564 5
abcde1234565 1
Thanks a lot in advance.
Pablo

Nov 12 '05 #2
Hello, Phil,
Thanks for reply.
The problem is that I was given the data and asked to update them. I
am not designing any input form. The data came from a database that
was not well designed. When they entered the pharmacy data, they just
enter duplicate claim number for a claim with mutile lines. So now I
am supposed to add service lines, so the combination of service line
and claim number could serve as primary key. Even though I have
figured out a way to get the goal by using SQL's cross join funciton
(not available in Access), I still want to be able to get a way to do
it in Access environment.
But anyway, thanks for help.
Pablo

"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message news:<3f***********************@mercury.nildram.ne t>...
I may be wrong, but shouldn't you be using 2 tables, 1 for the ClaimNum
which would only need to be entered once, and thus avoid typing mistakes and
1 table for the line numbers. I am guessing that they hold more information
than just a number, possibly drug names.
entry would be via a form and subform
the linenumber would be incremented BeforeInsert of something in the subform

HTH

Phil
"Pablo" <pa*****@hispavista.com> wrote in message
news:e9**************************@posting.google.c om...
Hello, there,
I have a table tblData which has pharmacy data. The table has
following fields:
ClaimNum, LineNum...

The ClaimNum has claim number which is 12 characters. LineNum is NULL.
The table looks like this
ClaimNum LineNum
abcde1234561
abcde1234561
abcde1234562
abcde1234563
abced1234564
abcde1234564
abcde1234564
abcde1234564
abcde1234564
abcde1234565

The thing is that I have some duplicate ClaimNum, which is
understandable because some claims may have mutiple lines. I would
like to update the [LineNum] to 1 if the ClaimNum is not duplicate, to
2 if it is the second duplicate, to 3 if it is the third duplicate...
So, the combination of ClaimNum and LineNum could serve as Primary
key.

so the table would look like
ClaimNum LineNum
abcde1234561 1
abcde1234561 2
abcde1234562 1
abcde1234563 1
abcde1234564 1
abcde1234564 2
abcde1234564 3
abcde1234564 4
abcde1234564 5
abcde1234565 1
Thanks a lot in advance.
Pablo

Nov 12 '05 #3

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

Similar topics

8
by: Mark | last post by:
When my form goes to a new record, I have a procedure that copies the last record added to the form's underlying table into the form. The intent is that a series of new records may have the same...
9
by: vbportal | last post by:
Hi, I would like to add BitArrays to an ArrayList and then remove any duplicates - can someone please help me forward. I seem to have (at leaset ;-) )2 problems/lack of understanding (see test...
4
by: sri2097 | last post by:
Hi all, I'm storing number of dictionary values into a file using the 'cPickle' module and then am retrieving it. The following is the code for it - # Code for storing the values in the file...
3
by: skennd | last post by:
Here's my problem in exact replication: I have used the find duplicate query in Access, and the query determined the following duplicate values by the following query: In (SELECT FROM As...
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
4
by: FangQ | last post by:
hi I am very new to mysql. I have a question about using the "on duplicate update" clause with insert command. my table "data" has two columns, field1 and field2, where field1 is the index...
2
by: mavmavv | last post by:
I have a Form where I have created a duplicate record button, no problem... The subform is where my problem lies. The subform displays data matching the mainform's ID, these two values are...
3
by: rajeshkrsingh | last post by:
Hi friends, Step1- create table duplicate ( intId int, varName varchar(50) ) insert into duplicate(intId,varName) values(1,'rajesh') insert into duplicate(intId,varName) values(2,'raj12')...
2
by: raphael001 | last post by:
In my Visual Basic program I'm just trying to find duplicate values entered into an array from an inputbox, but i can't seem to get the coding right on the final part to check for duplicate values...
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...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.