CoffeeGuru
Registered User.
- Local time
- Today, 18:42
- Joined
- Jun 20, 2013
- Messages
- 121
Apologies if this is so easy in Excel I'd do this in VBA, in Access I haven't a clue but assume SQL can do this.
I am trying to get a user to enter a year and week number and get Access to append this to Table "A01 Date"
This I have managed by creating a Query
Qry
A01 Enter Date 1
Field Y: [Enter Year (format yyyy)] APPEND TO Year
Field W: [Enter week (format #)] APPEND TO Week
Year and Week are from Table A01 Date
What I am currently doing is writing a whole series of queries that then take week-1 then -2 then -3 etc
Qry
A02 date 1 on Date SET
Field Year Table A01 Date APPEND TO Year
Field w:[Week]-1 Table A01 Date APPEND TO Week
Qry
A03 date 1 on Date SET W1 -1
Field Year Table A01 Date APPEND TO Year
Field w:[Week]-1 Table APPEND TO Year
My question is how can I ask the user to enter the number of historic weeks to work with 1 -52
and make a loop to append the results to a table.
If this makes no sense please prompt me for more information
----
Update
I have noticed whilst playing with this the long way, that I need to allow for year 2013 week 1 minus 1 = year 2013 Week -2 Hmmm
Need to make sure that this goes to 2012 Week 52
I think I need to have a field that is a real date to do this :banghead:
I am trying to get a user to enter a year and week number and get Access to append this to Table "A01 Date"
This I have managed by creating a Query
Qry
A01 Enter Date 1
Field Y: [Enter Year (format yyyy)] APPEND TO Year
Field W: [Enter week (format #)] APPEND TO Week
Year and Week are from Table A01 Date
What I am currently doing is writing a whole series of queries that then take week-1 then -2 then -3 etc
Qry
A02 date 1 on Date SET
Field Year Table A01 Date APPEND TO Year
Field w:[Week]-1 Table A01 Date APPEND TO Week
Qry
A03 date 1 on Date SET W1 -1
Field Year Table A01 Date APPEND TO Year
Field w:[Week]-1 Table APPEND TO Year
My question is how can I ask the user to enter the number of historic weeks to work with 1 -52
and make a loop to append the results to a table.
If this makes no sense please prompt me for more information
----
Update
I have noticed whilst playing with this the long way, that I need to allow for year 2013 week 1 minus 1 = year 2013 Week -2 Hmmm
Need to make sure that this goes to 2012 Week 52
I think I need to have a field that is a real date to do this :banghead:
Last edited: