Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Columns & Append Question...

Status
Not open for further replies.

ChiTownDiva

Technical User
Jan 24, 2001
273
US
I'm trying to hold some data for a period of time..

I have a table:

RC Code Count Count1 Count2
E8 26
S3 128
QB 56

This is the count is as of today. Next week (11/22), when I look at the table I want it to look like this:

RC Code Count Count1 Count2
E8 26 13
S3 128 122
QB 56 43

The week after that (11/29), I want the table to like like this:

RC Code Count Count1 Count2
E8 26 13 10
S3 128 122 111
QB 56 43 38

The Fourth week (12/6), I want it to look like this:

RC Code Count Count1 Count2
E8 13 10 10
S3 122 111 100
QB 43 38 26

So, I guess in a nutshell, I want the columns to roll based on the date.

I guess I need to know which direction I need to start in. I have the intial table built and populated, but I'm not sure how to write the code to delete the count column, move the data from Count1 and then populate the last count column.

Any help would be appreciated.

Thanks.

ChiTownDivaus [ponytails2]
 
Hiya,

Seems only 2 ways to do this:

1) Your table structure.
When you want to 'roll' : Replace column (1) & (2) data
with column (2) & (3) data respectivley and nullify
column (3) data. (As you want now)

or:

2) Design a table with Count, WeekNum and Deleted fields.
The Deleted field would be a yes/no, which would enable
you to 'disregard' this record - but still retain it's
info. for future use.
All you would need to do to exclude these records is set
Deleted to TRUE.


If you're set on 1 then I'll respond. (If it ain't solved already!)

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
I think I'm inclined to go with number two. What if a person runs the application twice?

I think I need something that will test the last time the application was ran.

Any ideas?

Thanks.

ChiTownDiva [ponytails2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top