Query question regarding weeks

  • Thread starter Thread starter ryan.fitzpatrick3
  • Start date Start date
R

ryan.fitzpatrick3

I have a query where it downloads information out of our database.
This database has volumes of items in weeks instead of days. so the
format would be 200801 for 2008 week 1, 200802, 200803, etc etc. Now I
want the last or most current week in the table, so I tried doing last
or max to get 200824, since we are in the 24th week of the year. The
table would look like this

item# item name quantity week
112345 shoes 100 200801
112345 shoes 56 200802
112345 shoes 112 200803

etc
etc

for all items.

How can I get it just to reflect the current week we are in only? I
know I can type 200824 in the criteria and that will work but in 3
months from now when its week 200832 I don't want to manually type in
200832 or whatever week it is in. Like I mentioned above when I used
last or max, it pulls the last or max of each week since they are
different.

Ryan
 
I have a query where it downloads information out of our database.
This database has volumes of items in weeks instead of days. so the
format would be 200801 for 2008 week 1, 200802, 200803, etc etc. Now I
want the last or most current week in the table, so I tried doing last
or max to get 200824, since we are in the 24th week of the year. The
table would look like this

item# item name quantity week
112345 shoes 100 200801
112345 shoes 56 200802
112345 shoes 112 200803

etc
etc

for all items.

How can I get it just to reflect the current week we are in only? I
know I can type 200824 in the criteria and that will work but in 3
months from now when its week 200832 I don't want to manually type in
200832 or whatever week it is in. Like I mentioned above when I used
last or max, it pulls the last or max of each week since they are
different.


You can set the query's week field's criteria to something
like:
=(SELECT Max(X.week) FROM table As X)
 
When I copy and paste the code in, am I to change any of the code to
reflect anything of mine, like the table? Also when I copy and paste
and run the query is pops up an input box with X.weeks
 
Back
Top