Create table query syntax

J

Jack Sheet

Hi all

Could someone please give me the narrative/syntax for a simple create table
query that has the following effect?

T_Clients contains
ID_Clients = autonumber, primary key
YEM = number, integer in range 1 to 12 incl
YED = number, integer in range 1 to 31

T_ClientsROLL1 contains
ID_ClientsROLL1 = autonumber, primary key
ID_Clients = number
RollDateStage1 = date

There is a 1-1 relationship begween T_Clients.ID_Clients and
T_ClientsROLL1.ID_Clients

Q_RollStage1 is an action query that needs to do the following.
1) delete all existing records in T_ClientsRoll1
2) re-populate T_ClientsRoll1 with one record for each recond in T_Clients,
but in the process inserting into RollDateStage1 a calculated value equal to
DateSerial(2006,T_Clients.YEM,T_Clients.YED)

Thanks very much. The Create Table options in design view do not seem to
give this opportunity so I guess it has to be done in SQL view.
 
J

Jack Sheet

UFF! Forget this. I just created a new field in T_Clients and ran an update
query to populate that field based on the other existing fields in
T_Clients. Seems to work.
 
E

Ed Robichaud

You should seriously rethink your table structure. 1-1 relationships are
seldom necessary, particularly when you are repeatedly deleting and
replacing those same records, copying records/values from other tables, and
storing a calculation.
-Ed

Jack Sheet said:
UFF! Forget this. I just created a new field in T_Clients and ran an
update query to populate that field based on the other existing fields in
T_Clients. Seems to work.
 
J

Jack Sheet

I agree.
It is only temporary, while I get the data arranged the way that I want it.

Ed Robichaud said:
You should seriously rethink your table structure. 1-1 relationships are
seldom necessary, particularly when you are repeatedly deleting and
replacing those same records, copying records/values from other tables,
and storing a calculation.
-Ed
 

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

Similar Threads


Top