M
magicdds
I have an append query that takes data from Table1 and Table2 and appends the
data to Table3 for a mailmerge. Table1 and Table2 are joined by field
PatientID - list all records from Table1 and those in Table2 where the joined
fields are equal.
In the query builder, I brought in those fields from Table1 that need to be
appended into Table3. I also brought into the query builder Table2* . I
didn't specify field names for Table2 because the field names are constantly
changing (in other parts of the programming). So the field PATIENTID must
therefore come from Table2 (if brought down from Table1, I get an error that
there are two things trying to be appended to the PatientID field in Table3).
The problem comes in when there is no record in Table2 for a record in
Table1. Then the record that is appended into Table3 has no entry in the
PATIENTID field. This field must somehow get the PATIENTID from Table1 if
there is no record for that PATIENTID in Table2.
Is there a way to do this? Or the other option, is there a way, in the
query builder to bring in all fields from Table2 (using Table2*) but leave
out PATIENTID so that the field PATIENTID can be brought into the query
builder from Table1?
Thanks,
Mark
data to Table3 for a mailmerge. Table1 and Table2 are joined by field
PatientID - list all records from Table1 and those in Table2 where the joined
fields are equal.
In the query builder, I brought in those fields from Table1 that need to be
appended into Table3. I also brought into the query builder Table2* . I
didn't specify field names for Table2 because the field names are constantly
changing (in other parts of the programming). So the field PATIENTID must
therefore come from Table2 (if brought down from Table1, I get an error that
there are two things trying to be appended to the PatientID field in Table3).
The problem comes in when there is no record in Table2 for a record in
Table1. Then the record that is appended into Table3 has no entry in the
PATIENTID field. This field must somehow get the PATIENTID from Table1 if
there is no record for that PATIENTID in Table2.
Is there a way to do this? Or the other option, is there a way, in the
query builder to bring in all fields from Table2 (using Table2*) but leave
out PATIENTID so that the field PATIENTID can be brought into the query
builder from Table1?
Thanks,
Mark