473,494 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Query Help for Inventory Tracking

Hi,

I am working on a query that displays depleted inventory. I need the
criteria to be:

CURRENT WEEK (Format(Now(),"ww") QTY = 0
and
PREVIOUS WEEK (Format(Now(),"ww")-1) QTY <> 0.

Ultimately, the query results would be similar to this:

PartNo Description Week 41 Week 42
123 Widget 1 234 0
236 Widget 7 29 0
420 Widget 53 89 0

Any help you can lend would be appreciated.

Henry

Nov 13 '05 #1
4 1437
"Henry Stockbridge" <hs***********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi,

I am working on a query that displays depleted inventory. I need the
criteria to be:

CURRENT WEEK (Format(Now(),"ww") QTY = 0
and
PREVIOUS WEEK (Format(Now(),"ww")-1) QTY <> 0.

Ultimately, the query results would be similar to this:

PartNo Description Week 41 Week 42
123 Widget 1 234 0
236 Widget 7 29 0
420 Widget 53 89 0

Any help you can lend would be appreciated.

Henry

You have not given any details of your table structure so it's hard for
anyone to help. Are there, say, two tables tblProduct and tblTransaction
from which the details can be worked out? What are the fields?
Nov 13 '05 #2
Table structure is Part Number (Text), Description (Text), Date (Short
Date), Week (Long Integer), Month (Long Integer), Qty (Long Integer.)

Each part has 52 records to accommodate the weeks of the year. That
way I can accommodate cross-tabbing the data. Perhaps not a good
structure?

Nov 13 '05 #3
"Henry Stockbridge" <hs***********@hotmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Table structure is Part Number (Text), Description (Text), Date (Short
Date), Week (Long Integer), Month (Long Integer), Qty (Long Integer.)

Each part has 52 records to accommodate the weeks of the year. That
way I can accommodate cross-tabbing the data. Perhaps not a good
structure?


Sorry for the delay - suddenly called away.
Anyway, it is a pretty bad structure. That is, you would not generally find
this in a professionally designed database - since the table is limited to
52 weeks and getting the data out can be difficult if you want to use a
standard query.
Normally, you might have a long skinny table PartNo, CheckDate, CheckQty
which is related to tblParts. Or perhaps you would have a table of
transactions, where the quantity in stock is calculated by the sum of the
transactions for each part.
Anyway, if you decide to keep your current table structure, then the only
way I can see for this query to work is to write a function in vba which
looks at today's date, works out the week number and then decides which
columns to select. This approach is OK but it means you can no longer
simply double-click a query. You could write the vba code in a report, so
you double-click the report which is similar.
Nov 13 '05 #4

"Henry Stockbridge" <hs***********@hotmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Table structure is Part Number (Text), Description (Text), Date (Short
Date), Week (Long Integer), Month (Long Integer), Qty (Long Integer.)

Each part has 52 records to accommodate the weeks of the year. That
way I can accommodate cross-tabbing the data. Perhaps not a good
structure?


Sorry for the delay - suddenly called away.
Anyway, it is a pretty bad structure. That is, you would not generally find
this in a professionally designed database - since the table is limited to
52 weeks and getting the data out can be difficult if you want to use a
standard query.
Normally, you might have a long skinny table PartNo, CheckDate, CheckQty
which is related to tblParts. Or perhaps you would have a table of
transactions, where the quantity in stock is calculated by the sum of the
transactions for each part.
Anyway, if you decide to keep your current table structure, then the only
way I can see for this query to work is to write a function in vba which
looks at today's date, works out the week number and then decides which
columns to select. This approach is OK but it means you can no longer
simply double-click a query. You could write the vba code in a report, so
you double-click the report which is similar.
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2369
by: jason | last post by:
Access 2000: I have a customer-inventory table I need to loop through and compile a list of all the inventory items the customer is tracking. The problem I am finding is that a simple loop...
10
3453
by: Susan M. | last post by:
I'm trying to do a query that joins two tables. The trick is that I only want it to return rows based on a certain criteria. Table 1: Inventory Fields: Inventory #, Description Table 2:...
6
2155
by: wylie72 | last post by:
I'm trying to create a adodb recordset in an Access Module for updating but when I try to open it it returns EOF. However, I can cut and past the sql into QueryBuilder it returns the record. At a...
3
2178
by: Wired Hosting News | last post by:
Lets say I have 10 products in 10 different stores and every week I get a report from each store telling me how many items they have left for each of the 10 products. So each week I enter in 100...
5
3497
by: Wired Hosting News | last post by:
I tried to be breif and give a scenario so as not to be overlooked because it was soooo long. Let me give you real world. I am a manufacturer of goods and produce 11 items that are distributed...
2
1727
by: Trees | last post by:
I have a query I am trying to create based on another query (inventory) and a table. The inventory query shows the date, shift, Die set and the # of shifts remaining for each die set in...
4
2835
Sandboxer
by: Sandboxer | last post by:
I want to be able to program Access to provide for me, by individual day, what my contract obligations are to my customers. Will Access recognize all the individual days in between a date range...
2
3597
by: RoadrunnerII | last post by:
Hi All I am new to this forum and still learning MS Access. Hoping this is the right place to ask If not please let me know! Looking for some help with the SQL statements in Access 2003 with the...
0
2436
crystal2005
by: crystal2005 | last post by:
Hi, I am having trouble with some complex SQL queries. I’ve got winestore database, taken from Web Database Application with PHP and MySQL book. And some question about queries as the following ...
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.