geeta_m9
asked on
Updating a value in a column
I have an update query which I would like to run to update a value in a column for a particular set of records using the corresponding values from another table.
Currently in the "Update To" section of the update query (see attached), I am updating the value in the column, "Letter" with the corresponding value in the NSCPP_Students_Temp table. However, I would like to add an "N" before the value from the other table. So for instance, if the NSCPP_Students_Temp table record has the value "C", then I would like the value "NC" written to the column of NSCPP_Students. I tried using concatentation, i.e. "N" & [NSCPP_Students_Temp].Lett er but it isn't working, i.e., it still writes the letter without the "N" in front.
Update-Query-No-Shows.jpg
Currently in the "Update To" section of the update query (see attached), I am updating the value in the column, "Letter" with the corresponding value in the NSCPP_Students_Temp table. However, I would like to add an "N" before the value from the other table. So for instance, if the NSCPP_Students_Temp table record has the value "C", then I would like the value "NC" written to the column of NSCPP_Students. I tried using concatentation, i.e. "N" & [NSCPP_Students_Temp].Lett
Update-Query-No-Shows.jpg
Can you switch to SQL view and show the full value of the SQL statement?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here is the SQL:
UPDATE [NSCPP Students] INNER JOIN NSCPP_Students_Temp ON [NSCPP Students].PID = NSCPP_Students_Temp.PID SET [NSCPP Students].Letter = "N" & [NSCPP_Students_Temp].[Let ter];
UPDATE [NSCPP Students] INNER JOIN NSCPP_Students_Temp ON [NSCPP Students].PID = NSCPP_Students_Temp.PID SET [NSCPP Students].Letter = "N" & [NSCPP_Students_Temp].[Let
And that is not working?
Did you try the SELECT statement? Is the query updateable when you do it as a SELECT?
Is PID the primary key in table [NSCPP Students]?
Is your data in Access or linked from some other relational database?
Did you try the SELECT statement? Is the query updateable when you do it as a SELECT?
Is PID the primary key in table [NSCPP Students]?
Is your data in Access or linked from some other relational database?
ASKER
If found out the error did not lie with the query but by my "Temp" table not having any records in it to begin with because the data wasn't being imported into the correct table. I should checked the code.
I fixed the problem and it is now working.
I appreciate your help and I am sorry for wasting your time.
I fixed the problem and it is now working.
I appreciate your help and I am sorry for wasting your time.
Trust me, we have all made that mistake at least once.
You solved your own problem, I don't have a problem with you withdrawing the points you awarded me. Just click the "Request Attention" hyperlink on your original post and indicate you would like to reallocate points.
Dale
You solved your own problem, I don't have a problem with you withdrawing the points you awarded me. Just click the "Request Attention" hyperlink on your original post and indicate you would like to reallocate points.
Dale
ASKER
That's ok. Your suggestions helped point me in the right direction.