Expand

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a table with a column called time.

Time = 1,2,3,4,...
I want to expand the table so each time period has 5 extra period.

So it would look like

Column Time: Column Extra Period
1 1
1 2
1 3
1 4
1 5
2 1
2 2
2 3
......

Do you know how to do this?

Thanks
 
Jeff,
First, avoid using the field name Time. In Access it's a reserved word which indicates
the current system time.
I'll use the name WorkTime.

If you're saying your table (ex.name = tblTimes) now contains...
1
2
3
4
etc... and you want to get to the values you posted...

You'll need to create a table (call it tblCounter) with just one field [Counter]
(numeric byte), populated with just 5 records with values of...
Counter
1
2
3
4
5

Create a Select query using tblTimes and tblCounter with NO relationship between them
at all. This is called a Cartesian relationship.
Place WorkTime and Counter fields on the grid and run the query.
You'll see
1 1
1 2
1 3
1 4
1 5
2 1
2 2
etc... for all your WorkTime values.

Now take that same query "scheme" and use a MakeTable query to populate a new table
with the two values each in their own fields.
ex. name tblTimePeriods...
WorkTime Period
1 1
1 2
1 3
etc...

Dump the old table, rename the new one, and you should be all set.
 

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

Back
Top