How do I create columns based on other columns using SQL in Access?

S

shauny

Hi

I'm new to MS Access (used to using Oracle and other databases) and I'm
trying to create a new column called Surname, from the last field in an
existing column called name.

I know how to do it in SQL, and I could probably figure it out in VBA
if pushed, but I can't seem to find out where in MSAccess I actually
type commands!? I can create tables, columns, etc, but where do I
create a column from another (e.g. ALTER TABLE x ADD COLUMN...etc).

TIA

Shaun
 
B

Brendan Reynolds

Create a new query, and from the View menu choose SQL View.

I'm guessing that you're parsing a single full name column into separate
given name and family name columns? If so, you won't be able add the new
column(s) and insert the values in a single query. You'll need to use ALTER
TABLE to add the new column or columns (or just do that in design view) and
then execute a separate UPDATE query to insert values into the new
column(s).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top