Sorting data from single column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I would be extremly grateful if someone could help me with this problem!
I have a single table with 2 columns and I need to sort the table into
patient records but the patient identifier also has associated data beneth it
until it gets to the next identifyier eg. 1234567891 being the identifier
with the code beneth. all the identifiers are alway 10 numbers long and the
codes are alph numeric.

Field1 Field2
1$ 1234567891
2$ m45hd
2$ m76yf
2$ m91ka
1$ 9874563210
2$ m74u9
2$ m65kd

If I could somehow move the ID into a seperate field and then copy the ID
down until there is a different ID?

Thanks again for anyone who could help!
 
Can you add a third field to the table, maybe called PTData. You can then run
a query as follows:

DoCmd.RunSQL("UPDATE YourTableName SET PTData = Field2 WHERE Where Field1 =
'2$'")

You can then delete the extraneous records with another query, as follows:

DoCmd.RunSQL("DELETE * FROM YourTableName WHERE Field1 = '2S'")

Once you do the above, of course, you would:

1) Delete the Field1 from the table, as it's no longer necessary, and

2) Change your underlying program to save future patient data in the field
PTData.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top