G
Guest
I’m creating a patients database. I’m using the patients social security number as the primary key in the patients table. Now I’m creating a table which will contain all of the appointments of all patients. Since obviously most patients will have more than one appointment sooner or later I want the primary key to be the social security number followed by something else [XXX-XX-XXXX-1; XXX-XX-XXXX-2, etc. or something along those lines]. Is it possible to some how make the table assign this number automatically? Like for example creating a code on the Expression Builder to call the patients social security number and if it’s not found add it to the table with a primary key of XXX-XX-XXXX-1, or if its found count how many times and increment that number by 1? 1 record found XXX-XX-XXXX-2, 2 records found XXX-XX-XXXX-3, etc.
Thanks.
Thanks.