how to fill a column with a constant string in Access 2002

T

tonys

I added a column to a table and want to populate the column with a text
string. Using copy and paste only works for one record
 
W

Wayne Morgan

If you need the same value in every record for the new column, use an Update
query.

Example:
UPDATE Table1 SET Table1.Test1 = "My String";

When you run this query it will update the field Test1 to "My String" for
every record in Table1.
 
D

David Lloyd

Tony:

One alternative is to use an UPDATE query. For example:

UPDATE MyTable
Set MyNewColumn = "MyConstantString"

If the constant string varies you can add a WHERE clause to the above UPDATE
query.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


message I added a column to a table and want to populate the column with a text
string. Using copy and paste only works for one record
 
T

tonys

Thanks for reply it worked great. Also, I imported an amount field and need
to export it to a fixed width text field with leading zeroes or spaces. Can
you help.

Tonys
 
T

tonys

Thanks for your reply, it worked great. Also, I imported an amount field and
want to export it to a fixed width file with leading zeroes or spaces. Any
ideas will be appreciated.

Tonys
 
W

Wayne Morgan

Create a query based on the data you want to export. You will need to create
"calculated fields" in the query for the fields you want formatted. Format
as desired and use the query for the export.

Example:
AmountWithZeros:Format([AmountField], "0000000000.00")
 
Top