Live Scores
Shareware
Movie Stars
in
Access
Applications
(Entire Site)
Questions and answers to issues related to Microsoft: Windows, Applications, Development, Hardware, Server, Internet Protocols, Database, Exchange .
»
Applications
»
Microsoft Office
»
Access
»
SQL: Add column and populated it with values from 2 other fields and a word
SQL: Add column and populated it with values from 2 other fields and a word
HI,
I have a table which is missing a column.
Using a SQL command, I want to update my table with a new column and populate that column with two fields separated by a space and followed by a word. The database is 50,000 records so I prefer to do it in one command , or even two and be able for the table to update itself or create a new table with all the records including this.
Can anyone help?
field1 field2 field3 field4 newfield
var1 var2 var3 var4 "var1" & " " & "var3" & "word"
Thanks.
Solution: SQL: Add column and populated it with values from 2 other fields and a word
update table set newfield = field1 & " " & field2 & " " & field3 & " " & field4
and you are done.
However you may wish to save some space (although slow execution) and create a query:
select *, field1 & " " & field2 & " " & field3 & " " & field4 as NewField from table
Worth considering anyway