By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,790 Members | 1,407 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,790 IT Pros & Developers. It's quick & easy.

Automate Appending a Column to a Table Daily

P: 1
I would like to start tracking history on scores generated in a table daily. I created a new table to store the data and want to append one column every day with that day's scores. The field name for the daily column should be the date the column is appended. I can't find a way to do this with a macro. I'm guessing I need to run SQL code, but I'm a novice at SQL and can't get my code to run. Can anyone suggest a string of code to do this?
Aug 14 '17 #1

✓ answered by PhilOfWalton

Sorry, that's a very bad idea.

Your table should look more like

Expand|Select|Wrap|Line Numbers
  1. ID    The Date    Score
  2. 1     13/8/2017     55
  3. 2     13/8/2017     12
  4. 3     13/8/2017    102
  5. 4     14/8/2017     81
  6. 5     14/8/2017     66
  7. etc
  8.  
You can use SQL to group the scores by date, then show the sum of the scores, or the average or whatever you want.
It is also very easy to select a date range

Phil

Share this Question
Share on Google+
2 Replies


PhilOfWalton
Expert 100+
P: 1,430
Sorry, that's a very bad idea.

Your table should look more like

Expand|Select|Wrap|Line Numbers
  1. ID    The Date    Score
  2. 1     13/8/2017     55
  3. 2     13/8/2017     12
  4. 3     13/8/2017    102
  5. 4     14/8/2017     81
  6. 5     14/8/2017     66
  7. etc
  8.  
You can use SQL to group the scores by date, then show the sum of the scores, or the average or whatever you want.
It is also very easy to select a date range

Phil
Aug 14 '17 #2

NeoPa
Expert Mod 15k+
P: 31,418
I appreciate you haven't had a direct answer to your question. I'm sorry for that, and it's rare here.

Nevertheless you should understand that any help along such a route would be a complete abdication of responsibility on our part. What you seem to want is such an extraordinarily bad idea that no-one, in conscience, could willingly help you.

Please don't understand this comment as a criticism. I'm sure you've come to this from a spreadsheet-type understanding, where such an idea would make good sense. In a database scenario, however, that couldn't be further from the truth.

Phil has already suggested a good replacement design. You're in good hands there.
Aug 19 '17 #3

Post your reply

Sign in to post your reply or Sign up for a free account.