![]() |
|
|
|||||||
|
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
I have a table with one PatientNumber and TestDate fields among others. Each PatientNumber has several records with different TestDate. I added a new field called TestNumber and wanted to sort the table by PatientNumber and TestDate then update the TestNumber field to increment test numbers for each patient by test date. I was able to create the function to increment the numbers for each patient and reset the counter for the next patient, but the problem I'm having is to write an UPDATE SQL statement that does the update after sorting the data by PatientNumber then TestDate. ORDER BY or GROUP BY don't work with UPDATE queries. What's the best way to handle this? Thanks, Martha |
|
#2
|
|||
|
|||
|
Dear Martha,
I think it will be better to craete a new table contains Patients data and add the field TestNumber in this table. So you can create a summary query on the old table and update the value in TestNumber in the new table. Thanks Ahmed |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Data won't show up in table field | texzen123 | Forms | 3 | 11-26-2009 08:20 AM |
| Extra date field update | georgft | Forms | 0 | 09-17-2008 04:51 AM |
| Update Query with Field based on Combobox Selection | Dani1022 | Queries | 0 | 04-17-2008 07:24 AM |
| Update table from calculated field in a form | BernardKane | Forms | 3 | 11-28-2006 06:48 AM |
| I need to update a data field on a form and not on its table | Wrangler | Forms | 2 | 03-15-2006 10:43 PM |