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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update query

Status
Not open for further replies.

Monzer

Programmer
May 24, 2002
26
0
0
CA
Hi; I cant beleive that I cant solve this one!!!

I have an update query and its going to update several fields based on parameters. Its all good and working fine except one field. Its the ID field, I just want to update this field by adding the letter "R" before the ID number.

EX: if the ID field is "565" I want the query to update it to "R565". The ID field is a text field already.

Thanks in advance for any help.
 
What is your SQL view of the update query?
What are your results?
Does the ID field have any relationships or constraints?
What is the length of the field?

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Its a very simple field. Its set as a primary key,text(50).
All I want to do is add the letter "R" to the contenant of that field.

My update query updates (date,checkBox,ID). Thats all to it.

Thanks
 
You basically ignored most of my questions and repeated what you stated earlier.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Provided the ID field is not defined as foreign key in another table:
UPDATE yourTable SET ID='R' & Trim([ID]) WHERE Left([ID],1)<>'R';

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top