How to create special auto numbering

I've got a challenge that many may have when importing a database in
mysql and not sure which is the better tool to use as I'm using Excel
but can use Access. I have a great list of doctors that also has their
specialties. Every doctor listing has a listing ID. The problem is as
follows - if a doctor has more than 1 specialty, there is a second
listing that has its own unique ID. For this to work, this needs to be
a one to many relationship where there is one unique ID for listing
and that listing is used to display in different categories.

Let's say my spreadsheet is set up as follows:

ListingID	ListingName	Address		ListingSpecialty
111		Joe		1 Park		Heart
112		Jane		2 Broadway	Blood
113		Jim		3 Main		Nose
114		Jim		3 Main		Ear
115		Jim		3 Main		Throat


So I'd like to create a function or query that will see if the cell
for the name of the doctor is the same (ListingName and Address), then
it would use the same listing IDnumber. This way if I import it into
an application, the application will read in the same listing number
and will automatically associate the "duplicate" IDs as being a second
specialty. This application already knows what to do with the
duplicate ID and can read the ListingSpeicalty field and create the
multiple association of that listing. So in this example, Jim is
listed three times. The numbers are unimportant and can be renumbered.
But what I want to do is have the numbers renumbered as 111, 112, 113,
113, 113 because Jim is the same listing.

At first I thought of converting names and address field and combine
and convert to integers but I'd have to think that through and there
must be a better way, macro, query, etc. I've got about 200,00 doctors
so that's why manual solutions wont work. Any ideas? Suggestions much
appreciated!

0
Slink
5/26/2009 3:52:27 AM
excel 39879 articles. 2 followers. Follow

3 Replies
362 Views

Similar Articles

[PageSpeed] 40

Actually, Slink, you don't have a one-to-many relationship; you have a 
many-to-many. Many doctors can have the same specialty, and many specialties 
apply to many doctors. And, to implement that in Access, you'll use a 
"junction" or "intersection" table with records each pointing to ("with a 
foreign key to") a single doctor record and a single specialty record.

 Larry Linson
 Microsoft Office Access MVP

"Slink" <slinky__isat_newsguy__.com> wrote in message 
news:45pm159s313acat5d2ggnjfacug0kdbg0r@4ax.com...
> I've got a challenge that many may have when importing a database in
> mysql and not sure which is the better tool to use as I'm using Excel
> but can use Access. I have a great list of doctors that also has their
> specialties. Every doctor listing has a listing ID. The problem is as
> follows - if a doctor has more than 1 specialty, there is a second
> listing that has its own unique ID. For this to work, this needs to be
> a one to many relationship where there is one unique ID for listing
> and that listing is used to display in different categories.
>
> Let's say my spreadsheet is set up as follows:
>
> ListingID ListingName Address ListingSpecialty
> 111 Joe 1 Park Heart
> 112 Jane 2 Broadway Blood
> 113 Jim 3 Main Nose
> 114 Jim 3 Main Ear
> 115 Jim 3 Main Throat
>
>
> So I'd like to create a function or query that will see if the cell
> for the name of the doctor is the same (ListingName and Address), then
> it would use the same listing IDnumber. This way if I import it into
> an application, the application will read in the same listing number
> and will automatically associate the "duplicate" IDs as being a second
> specialty. This application already knows what to do with the
> duplicate ID and can read the ListingSpeicalty field and create the
> multiple association of that listing. So in this example, Jim is
> listed three times. The numbers are unimportant and can be renumbered.
> But what I want to do is have the numbers renumbered as 111, 112, 113,
> 113, 113 because Jim is the same listing.
>
> At first I thought of converting names and address field and combine
> and convert to integers but I'd have to think that through and there
> must be a better way, macro, query, etc. I've got about 200,00 doctors
> so that's why manual solutions wont work. Any ideas? Suggestions much
> appreciated!
> 



0
bouncer (4)
5/26/2009 5:57:46 AM
Slink wrote:
> I've got a challenge that many may have when importing a database in
> mysql and not sure which is the better tool to use as I'm using Excel
> but can use Access. I have a great list of doctors that also has their
> specialties. Every doctor listing has a listing ID. The problem is as
> follows - if a doctor has more than 1 specialty, there is a second
> listing that has its own unique ID. For this to work, this needs to be
> a one to many relationship where there is one unique ID for listing
> and that listing is used to display in different categories.
> 
> Let's say my spreadsheet is set up as follows:
> 
> ListingID	ListingName	Address		ListingSpecialty
> 111		Joe		1 Park		Heart
> 112		Jane		2 Broadway	Blood
> 113		Jim		3 Main		Nose
> 114		Jim		3 Main		Ear
> 115		Jim		3 Main		Throat
> 
> 
> So I'd like to create a function or query that will see if the cell
> for the name of the doctor is the same (ListingName and Address), then
> it would use the same listing IDnumber. This way if I import it into
> an application, the application will read in the same listing number
> and will automatically associate the "duplicate" IDs as being a second
> specialty. This application already knows what to do with the
> duplicate ID and can read the ListingSpeicalty field and create the
> multiple association of that listing. So in this example, Jim is
> listed three times. The numbers are unimportant and can be renumbered.
> But what I want to do is have the numbers renumbered as 111, 112, 113,
> 113, 113 because Jim is the same listing.
> 
> At first I thought of converting names and address field and combine
> and convert to integers but I'd have to think that through and there
> must be a better way, macro, query, etc. I've got about 200,00 doctors
> so that's why manual solutions wont work. Any ideas? Suggestions much
> appreciated!

If possible, I would do this upstream in the database. Create a separate 
view (select query) VW_1 to return MIN(ListingID) GROUP BY ListingName, 
Address;

In another view VW_2, join VW_1 to the main table on ListingName and 
Address. Return Listing ID from VW_1 and the remaining fields from the 
main table as your final data.

Note if the ID numbers are truly unimportant (and they shouldn't be), 
you won't mind that they will no longer be sequential. But they will be 
more meaningful than arbitrarily renumbering, as you can tie them back 
to a record in the source data.
0
smartin108 (170)
5/26/2009 10:24:24 PM
On Tue, 26 May 2009 18:24:24 -0400, smartin <smartin108@gmail.com>
wrote:

>Slink wrote:
>> I've got a challenge that many may have when importing a database in
>> mysql and not sure which is the better tool to use as I'm using Excel
>> but can use Access. I have a great list of doctors that also has their
>> specialties. Every doctor listing has a listing ID. The problem is as
>> follows - if a doctor has more than 1 specialty, there is a second
>> listing that has its own unique ID. For this to work, this needs to be
>> a one to many relationship where there is one unique ID for listing
>> and that listing is used to display in different categories.
>> 
>> Let's say my spreadsheet is set up as follows:
>> 
>> ListingID	ListingName	Address		ListingSpecialty
>> 111		Joe		1 Park		Heart
>> 112		Jane		2 Broadway	Blood
>> 113		Jim		3 Main		Nose
>> 114		Jim		3 Main		Ear
>> 115		Jim		3 Main		Throat
>> 
>> 
>> So I'd like to create a function or query that will see if the cell
>> for the name of the doctor is the same (ListingName and Address), then
>> it would use the same listing IDnumber. This way if I import it into
>> an application, the application will read in the same listing number
>> and will automatically associate the "duplicate" IDs as being a second
>> specialty. This application already knows what to do with the
>> duplicate ID and can read the ListingSpeicalty field and create the
>> multiple association of that listing. So in this example, Jim is
>> listed three times. The numbers are unimportant and can be renumbered.
>> But what I want to do is have the numbers renumbered as 111, 112, 113,
>> 113, 113 because Jim is the same listing.
>> 
>> At first I thought of converting names and address field and combine
>> and convert to integers but I'd have to think that through and there
>> must be a better way, macro, query, etc. I've got about 200,00 doctors
>> so that's why manual solutions wont work. Any ideas? Suggestions much
>> appreciated!
>
>If possible, I would do this upstream in the database. Create a separate 
>view (select query) VW_1 to return MIN(ListingID) GROUP BY ListingName, 
>Address;
>
>In another view VW_2, join VW_1 to the main table on ListingName and 
>Address. Return Listing ID from VW_1 and the remaining fields from the 
>main table as your final data.
>
>Note if the ID numbers are truly unimportant (and they shouldn't be), 
>you won't mind that they will no longer be sequential. But they will be 
>more meaningful than arbitrarily renumbering, as you can tie them back 
>to a record in the source data.

Guys - thanks so much!!! But I actually did something very, very easy.
It worked on my first sheet - I just used an if statement:

=IF(AND(A5=A4, B5=B4),D4+0,D4+1)

This translates if the name column is equal and the address column is
equal then the record is the same so don't increment the number. If it
is different, new record so add one. That worked well.

To get the records the same on the flat file, it was also easy. Create
two new columns and run the formula. If number is the same (same
record) copy the value of the specialty cell to the cell adjacent to
the record so it looks like:

Jim	3Main 	Nose	Ear

Now I can import all the values this way. :)

The only problem I'm having now is that while the formula worked in
one spreadsheet, it's not working now. It makes no sense because it's
as if the formula is ignoring the value in the cells... weird.
0
Slinky
5/27/2009 7:44:10 PM
Reply:

Similar Artilces:

create a roster
How can you create a weekly roster in which functions can be assigned to more than 10 people. The roster should be updatable, so that when holidays and days off are marked on the weekly roster they will be taken account of it future rosters. ...

So many Tunnel Adapters
Hi, I understand that Tunnel Adapter LAN is for encapsulating IPv6 packets with an IPv4 header so that they can be sent across an IPv4 network. Few queries popped up in my mind based on this :- 1. Why is the numbering for the Tunnel adapter LAN not sequential ? It is like 6,7,12,13,14,15,16. A strange numbering scheme ?! I tried to figure it out by thinking of some arithmetic series. But, it does not seem to fit in. There is a huge gap between 7 and 12. Any ideas ? 2. What is the need for so many number of Tunnel Adapter LAN connection ? Can you tell me a scenario that re...

importing or creating reference footnotes
I am trying to import a word document into publisher and it has reference footnotes within the document. The reference footnotes are not coming into the publisher document with the reference footnotes. Correct, they will not up to Publisher 2003. In Publisher 2003 depending on which version of Word you are using if they will or not. -- "If you don't know where you are going, any road will take you there!" ...

VBA Question
Hi, I have a form with a combobox control that list some sizes. They are: 12 18 20 22 I have another text box for keying a custom size, such as 12'2". What I would like to do is have the combobox default to the next size (in this case 18). Here's the code I have used so far (it does a little more than what I am asking for but to give an idea): Dim MCUST As String MCUST = Me.custwidth If Str(Me.widthck) <> Me.custwidth Or Len(Me.custwidth) <> Len(Me.widthck) Then Me.widthck.Value = Int(Val(MCUST)) + 1 If InStr(Int(Me.widthck) / 2, ".&...

Task Create - Status
I'm trying to make a simple task, when a user owner is assigned a task in CRM, it receives an email letting it know it has one. I have the following below, but it is not generating one when i assign one manually in the CRM. What to do? I've tried both the following: When task is created E-Mail to:[owner];Subject test As well as: When task is created if Task activity status = Open then E-Mail to:[owner];Subject test I've checked the mailserver many times over, and I can send emails manually from the CRM so you can rule that out Tested out ok on our end. Some ideas:...

How Enter Special Character With Dots Over It?
Hello. I need to enter special characters with dots over them. I know this can be done with vowels and the letter 'y' by keying Shift-Control and then the letter. But I need to do it over *consonants* - at least capital B and V and maybe so others. If beggars can be choosers, I would very much prefer three dots instead of just two. Any ideas? Thanks! On Wed, 27 Jan 2010 18:15:01 -0800, Peyton Todd <Peyton Todd@discussions.microsoft.com> wrote: >Hello. I need to enter special characters with dots over them. I know this >can be done with vowels and the l...

Mailbox not created when AD account created
A couple of days ago I noticed that I created a user account but the 'Email Addresses' tab of the user properies did not list any email addresses. Subsequent new user accounts have all experienced the same. I researched the knowledge and tried the recommended solutions to either manaully start the recipient update service or rebuild te recipient update service. Neither recommendation has resulted in a mailbox being created for this particular user or any additional user that I have created since this error first showed up. I performed a Windows update last Thursday and so I bel...

Help Creating XmlNode / XmlAttribute Elegantly
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString" value="server=(local);" /> </appSettings> </configuration> I am using a XmlDocument for my base implementation. I am looking to see if there is a better way to add a new node / attribute than using XmlDocument.InnerXml. I would consider this to be a hack but couldn't really see another way of doing this without definin...

Create external database
Hi all. I need to create an external database (file). On a site I found this code: ------------------------------------------------------ Function CreateLinkedExternalTable(strTargetDB As String, strProviderString As String, strSourceTbl As String, strLinkTblName As String) As String 'strTargetDB = Source Database Name 'strProviderString = Not used, currently hard coded 'strSourceTbl = Source Table name in the database we are linking too. 'strLinkTblName = Table name we would like to see in the Access Database. Dim catDB As ADOX.Catalog Dim tblLink As...

Auto Send and Receive Not Working
I have a user, my boss, that we setup to POP whether internally or externally. It works when we manually hit the Send and Receive button; however, we would like to have it automatically do this. I setup the Schedule Auto Send and Receive for 2 minutes and it will not work. What could be the problem? RickCass On 29 Apr 2004 12:11, "RickCass" <anonymous@discussions.microsoft.com> wrote: >I have a user, my boss, that we setup to POP whether internally or >externally. It works when we manually hit the Send and Receive button; >however, we would like to have...

How to create pie chart with %
I have got a problem that I don't if excel could help me to calculate the % within a column and draw a pie chart. My case is I have a column containing a series of numbers. e.g. 1,4,8,1,3,9,11,2,4,5,6,.........etc I want to draw a pie chart that showing 1-3 , 4-6, 7-9, >9 with the corresponding % inside that column. Can anyone tell me how can I make it ? Ray - You need to calculate the frequencies in your data. Let's assume your data is in A1:A12. In B1:B3 enter these numbers, the upper limits on the groupings: 3 6 9 You can enter ">9" into B4 witho...

Continuous form record number
I have a form whose default view is 'continuous form'. Then when I click a button I need to delete the record where the mouse is (was just) placed. How can I find out the record number? Alternatively any idea is welcome. Thanks Henry "H. Martins" <hjrmartins@gmail.com> wrote in message news:b4ab14e1-51c6-4c16-8a78-bc7df76670de@k31g2000vbu.googlegroups.com... >I have a form whose default view is 'continuous form'. > > Then when I click a button I need to delete the record where the mouse > is (was just) placed. > > Ho...

Email address not created when a new user is created
All, This issue recently happened in my company. Upon creating a new user, the policy was set to create the smtp and X400 address automaticaly. Now when we create a user the smtp and x400 addresses are not created, and when attempting to setup the new user in outlook, the address cant be found. We are using exchange 2003 SP1 on Win2k3 servers. On Wed, 13 Jul 2005 06:49:07 -0700, "Bryan" <Bryan@discussions.microsoft.com> wrote: >All, >This issue recently happened in my company. Upon creating a new user, the >policy was set to create the smtp and X400 addres...

Exchange 2010 MRM, no log files being created
I'm hoping someone can help me with this issue....it has been driving me crazy for days. I have enabled MRM logging on our exchange server, and I can see that some of the policies are working when I run start-managedfolderassistant. We have a retention policy tag on the deleteditems folder, and this does work. The problem is I am not getting any files in the MRM log directory. C:\Program Files\Microsoft\Exchange Server\V14\Logging\Managed Folder Assistant Events 9021 and 9022 are logged in the Application log, but where are the files? Below is the output of my mai...

when form created
I have a form which was created by someone else (not a form template) which is like a questionnaire with empty boxes to be completed. When the boxes are typed in all the margins move to accommodate the words being typed. Is there a way to fix/lock the original form and then just fill in the blank boxes? I suspect this is set up as a table with auto resizing enabled. Displaying table gridlines (Table | Show Gridlines) will help you see what you're dealing with. Then select the table, go to the Table tab of Table Properties, click Options, and clear the check box for "A...

Creating a Brochure
How do you create a 3-column brochure from scratch for Publisher 2002? I can only find the directions for the 2003 version. Quick help would be appreciated, project is due Monday. Create a three-panel or four-panel folded publication http://office.microsoft.com/en-us/assistance/HP011646681033.aspx Scroll down to the section that says "Build a three-panel or four-panel publications from scratch." -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Derek" <Derek@discussions.microsoft.com> wrote in message news...

similiar upgrade question, on upgrades do contact info auto load, or
do you have to use pst files All data contained in a *.pst file Other than that yr Q is a little hard to follow. "bob" <bob@donotspam> wrote in message news:ex66JE1qEHA.372@TK2MSFTNGP12.phx.gbl... > do you have to use pst files > > ...

Users mailboxes not created when user created
I have a problem that recently just started happening on my exchange 2003 server. When i create a new user account and create the mailbox for exchange, once im done, the mailbox isnt created, adn if you go into the properties of the user account adn go to the exchange email address tab, there isnt an smtp or an x.400 address listed. I am having to manually create and add these, adn then go delete the exchange mailbox and recreate it. This is really annoying and would love to know if anyone has any ideas of how to fix it. Thanks Jason In news:9F836A43-98BF-435A-AA43-AFF10124BE3F@micro...

Next Check Number
Is there any way to set the number used for Next Check Number in a bank account register. My problem is that I use one checkbook at home and my wife and I each carry checkbooks. The checkbook at home, which I use most frequently, happens to have the lowest check numbers. As soon as I entered a check from one of the other books, Next Check Number keeps using that (the highest number so far) as the basis for Next Check Number and I have to manually enter almost all of my check numbers. (I recently switched from Quicken where the corresponding function always used the most recently en...

How to create Access macro shortcut
I'm still using Access 97 and saw something the other day that I would like to use that was in Access 2000. In an Access 2000 database, there was a .mam file in a directory that launched the Access 2000 program and ran a macro. How do you set this up? Can it be done in Access 97? If so, how? Hi. > How do you set this up? Select the macro in the Database Window and right click with your mouse, then select "Create Shortcut..." in the pop-up menu. Follow the prompts for where to place the shortcut and what to name it. The default is: <PathToDeskTopDir>\Shortcut ...

CRM should let me create custom fields in batch
Hi, With MS CRM v3.0, when we have a group of fields to create, it would be faster to be able to enter the list and then submit the list for processing. Thank you. Felix. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/C...

Creating an ad book
How do I divide a page into equal sections (halves, qarters, eights)? I need to scan and type ads and coupons into this booklet. New at this. After managing to set up OE-QuoteFix on his new PC, Ed reads a message from FRSH <anonymous@discussions.microsoft.com>... > How do I divide a page into equal sections (halves, qarters, eights)? Arrange > Layout Guides > Grid Guides -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading this message, view the disclaimer: http://mvps.org/the_nerd/disclaim.htm ...

Entering Phone Numbers in a new entry
Is it possible to change or add categories to the drop down list where one enters phone numbers in an entry. For instance I seem to have entries that require two mobile entries and I would like to label them mobile 1 and mobile 2. Is this possible and how is it done. Thank you for your assistance. Submitted using http://www.outlookforums.com "Dwain Mitchell" <dwainmnd[at]cox[dot]net> wrote in message news:ediHfeyXKHA.4648@TK2MSFTNGP05.phx.gbl... > Is it possible to change or add categories to the drop down list where one > enters phone numbers in an entry. For instan...

Access unable to create an MDE
I am getting this message when I try to make an MDE: "Access unable to create an MDE database" No error mesages or any other info is displayed. I haven't had this trouble before. Then I added a form, a couple reports, an create table query, modified a toolbar and added a module. Now I am getting this message. This database is a front end of a project with several linked table to a back end. Any suggestions? Thanks Jeff G Try compiling your application (under the Debug menu when you're in the VB Editor). Often an application will have some error that doesn't m...

create a database from which bibliography an be created
How do I create a database from which a bibliography can be added to the end of a Word document? I used the program RefManager, but that is too expensive for me to update. Does Word 2003 have such a program? Thanks Not natively. Have you checked your academic institution? They might have campus licenses which students can use at home. You could give Zotero a spin (www.zotero.org). Personally, I don't like it, but that's just me. Word 2007 comes with referencing capabilities, but they are limited in functionality. Anything special you want, you would have to add i...