Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append query 1

Status
Not open for further replies.

dinster

Programmer
Apr 12, 2007
54
GB
Hi,

Am doin append query and each line i would like to add Primary diagnosis as well as to the field am appending?

But i dont think its right....this is what i got so far?

INSERT INTO Temp_Diagnosis ( PatientID, ["PRIMARY DIAGNOSIS: " & Diagnosis] )
SELECT T_PrimaryDiag.PatientID, T_PrimaryDiag.PrimaryDiag
FROM T_PrimaryDiag INNER JOIN [Temp PatID] ON T_PrimaryDiag.PatientID = [Temp PatID].[Computer Generated ID];
 
Is there a field for Primary Diagnosis in Temp_Diagnosis?
 
yes its Diagnosis


When i used diagnosis it worked. However when i include the string "Primary Diagnosis: " & Diagnosis

i thought that would include primary diagnosis and append too?

but i think i might av got the syntax wrong or something

many thanks for your reply
 
To follow up from Remou's post I'd imagine you'd just want to have your field to insert into as [Diagnosis] and concatenate in your SELECT query, something like:
Code:
INSERT INTO Temp_Diagnosis ( PatientID, [Diagnosis] )
SELECT T_PrimaryDiag.PatientID, "This is a test " & T_PrimaryDiag.PrimaryDiag
Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Glad I could help, thanks for the star [smile]

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top