Fields with the same information

P

Peter

I created a database with a table. There are two fields
that I would like to have the same information in them.
For expample STATE = NE and Railroad = BNSF. When I
created the table I didn't use Default Value at the time.
I now have all the information entered, added these two
new fields, and want to globally have the information
entered. Any help would be apprediated.

Thanks,

Peter
 
R

Rick Brandt

Peter said:
I created a database with a table. There are two fields
that I would like to have the same information in them.
For expample STATE = NE and Railroad = BNSF. When I
created the table I didn't use Default Value at the time.
I now have all the information entered, added these two
new fields, and want to globally have the information
entered. Any help would be apprediated.

Use an Update query...

UPDATE YourTableName
SET STATE = "NE", Railroad = "BNSF"
 
G

Guest

Thank you for your reply. Can you be a little more
specifice how to do thie and please keep in mind I'm new
to this.

Thanks

Peter
 
R

Rick Brandt

Thank you for your reply. Can you be a little more
specifice how to do thie and please keep in mind I'm new
to this.

Well, here in the newsgroups we have to post SQL for queries as we can't
put the query design grid into a text message.

Open a new query and use the toolbar to go to SQL view instead of the
default query design grid. Paste in the text ...

UPDATE YourTableName SET STATE = "NE", Railroad = "BNSF"

....replacing "YourTableName" with the actual name of your table. Then
change back to the standard query design view and you'll see what it would
look like had you created it that way. When you run the query it should
update all of the rows in your table.
 
G

Guest

When I go to open a new query I selet the BNSF Carman
Lincoln NE table. I don't select any fields and when I go
SQL view this is wha't in the box, SELECT
FROM [BNSF Carman Lincoln NE]; I paste what you said to
paste and keep getting errors. I'm using version 2002.
Thanks, Peter
 
C

Chris

Open the query. Select the table. Double click on the
fields to be updated. Next, on the toolbar, select
Query=>Update Query.

You will now see a new row that says UPDATE TO:

Under State, add "NE" in the Update To: row.
Under Railroad, add "BNSF" in the Update To: row.

hit the Exclamation point (run query), and your task is
done.

-----Original Message-----
When I go to open a new query I selet the BNSF Carman
Lincoln NE table. I don't select any fields and when I go
SQL view this is wha't in the box, SELECT
FROM [BNSF Carman Lincoln NE]; I paste what you said to
paste and keep getting errors. I'm using version 2002.
Thanks, Peter
-----Original Message-----


Well, here in the newsgroups we have to post SQL for queries as we can't
put the query design grid into a text message.

Open a new query and use the toolbar to go to SQL view instead of the
default query design grid. Paste in the text ...

UPDATE YourTableName SET STATE = "NE", Railroad = "BNSF"

....replacing "YourTableName" with the actual name of your table. Then
change back to the standard query design view and you'll see what it would
look like had you created it that way. When you run the query it should
update all of the rows in your table.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com




.
.
 
G

Guest

That worked great! Thanks for everyone's help.

Peter
-----Original Message-----
Open the query. Select the table. Double click on the
fields to be updated. Next, on the toolbar, select
Query=>Update Query.

You will now see a new row that says UPDATE TO:

Under State, add "NE" in the Update To: row.
Under Railroad, add "BNSF" in the Update To: row.

hit the Exclamation point (run query), and your task is
done.

-----Original Message-----
When I go to open a new query I selet the BNSF Carman
Lincoln NE table. I don't select any fields and when I go
SQL view this is wha't in the box, SELECT
FROM [BNSF Carman Lincoln NE]; I paste what you said to
paste and keep getting errors. I'm using version 2002.
Thanks, Peter
-----Original Message-----
Thank you for your reply. Can you be a little more
specifice how to do thie and please keep in mind I'm new
to this.

Well, here in the newsgroups we have to post SQL for queries as we can't
put the query design grid into a text message.

Open a new query and use the toolbar to go to SQL view instead of the
default query design grid. Paste in the text ...

UPDATE YourTableName SET STATE = "NE", Railroad = "BNSF"

....replacing "YourTableName" with the actual name of your table. Then
change back to the standard query design view and
you'll
see what it would
look like had you created it that way. When you run
the
query it should
update all of the rows in your table.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com




.
.
.
 
R

Rick Brandt

When I go to open a new query I selet the BNSF Carman
Lincoln NE table. [snip]

Ah, but I didn't say to select any tables did I? If you had just closed
the dialog for adding tables, gone to SQL view and pasted my string it
would have worked. Or if you had pasted my string *in place of* the SQL
that was already in your SQL window that would have worked as well (after
substituting your table name of course).

Glad you got it going at any rate.
 

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