I have been tasked with creating a BAQ which will return all parts for which there is a demand and that part contains a memo of a specific category.
The memo part is easy, but how does one query whether there is demand for a part? There exists a DemandHed table but it doesn’t have any part numbers in it. I am not sure what I’m actually looking for. Do I have to pull all scheduled jobs and get the part numbers from there or is there an actual table somewhere that stores demand?
I would (as @Chad_Smith suggested) start by looking at the PartDtl table… if you dont need the actual detail, you can summarize the table, but then when you DO want to know the detail it will all be there, with every demand, demand type, etc.
Yes, PartWhse is a summary, but getting back to your need you just need to know if is has any demand, so I would make a subquery grouped by Company and PartNum for a partdtl with a RequirementFlag = true and do an inner join to that so it filters the main query.
Well, maybe, but you can’t necessarily compare row counts. As mentioned earlier, PartWhse isn’t always correct. You can run the utility to synch it up if you want to see if they match then (Refresh Part Quantities and Allocations).
On the other hand, PartDtl is Time Phased (row per date/part combination), so you’ll want to summarize the results most likely. You’ll need to do a bit of Group By to get the totals you want.
You shouldn’t need the PartDtl.Qty > 0 because if there is demand, it’s already more than 0 but I also don’t think it’s hurting anything.