Adding Fields To Tables; by Query?

  • Thread starter Thread starter Tim Fierro
  • Start date Start date
T

Tim Fierro

Hello,

I could use a bit of help here since I have not
done this before.

Tables: tblVitem, tblOrderLine, tblInvoiceLine

1) I want to add a new field to each of the above tables.

2) I want to auto-populate this field with "12/31/2004".


I believe I use a Query to Update the tables, but I am
not exactly sure on the procedure to do this. I 'think'
that I go into the Query screen and somehow put the
line in there and press a button, but I am not sure. :-)



Can anyone help with the process on how to do this?



I would also like to add a field "ContractPrice" to the
table "tblVitem". Would I just follow the same
procedure as I do for the above? This field will be
auto-populated with an "N".


After a field has been added to tables, do I then go
into the Table edit screens to set the properties
like; Required, No Sort, 1 Digit Length, Text Field,
etc....? And the first update for the PostDate field,
I want that field to be a date field obviously. I am
asking this because I don't know if it is done afterwards,
or if it should be done in the Query to create the field.



Thank you,

Tim
 
I maybe should have mentioned that the field name for the tables posted
before, is going to be; "PostDate".

Tim
 
Hello,

I could use a bit of help here since I have not
done this before.

Tables: tblVitem, tblOrderLine, tblInvoiceLine

1) I want to add a new field to each of the above tables.

2) I want to auto-populate this field with "12/31/2004".


I believe I use a Query to Update the tables, but I am
not exactly sure on the procedure to do this. I 'think'
that I go into the Query screen and somehow put the
line in there and press a button, but I am not sure. :-)

The simplest way is to open the tables in Design view and add a
Date/Time field. Then create a new Query based on each table; make it
an Update query using the Query menu option; and type the desired date
delimited by # on the Update To line:

#12/31/2004#

I must ask though - what's the point of a field for which every single
record in the table contains the same date!?
Can anyone help with the process on how to do this?

Although you can use an ALTER TABLE query to add the field, it's
really simpler to use the table design grid. Post back if you have
some good reason not to do so.

John W. Vinson[MVP]
 
The simplest way is to open the tables in Design view and
add a Date/Time field. Then create a new Query based
on each table; make it an Update query using the Query
menu option; and type the desired date
delimited by # on the Update To line:

#12/31/2004#

I must ask though - what's the point of a field for which every single
record in the table contains the same date!?

John,

I want to 'default' this field to the same date that is in the past.
Instead of leaving these fields blank, I thought a default start value would
be more appropriate. Then in future reports I can request all closed items
previous to 10/24/05 for which all the current records would have that date.
All future closing lines will have dates sporadically in the mix as they
close throughout the months ahead. I also want this field to be required,
and figured since it is required, any past data will need some data in it.

I think what you posted puts me right in the direction I need to follow.
Add the field to the tables, then populate using a Query.

Tim
 
Back
Top