A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

FIFO Help



 
 
Thread Tools Display Modes
  #11  
Old September 6th, 2008, 11:57 PM posted to microsoft.public.access.tablesdbdesign
Graham Mandeno
external usenet poster
 
Posts: 593
Default FIFO Help

It's the (Select ... ) part in parentheses inside the WHERE clause.
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

"mattc66 via AccessMonster.com" u16013@uwe wrote in message
news:89c5a93fcd5df@uwe...
How do you add a sub query?

Graham Mandeno wrote:
Hi Matt

I was thinking that you would satisfy Order 1 then requery (stock qty is
now
3) then satisfy Order 2 and requery (stock is now 2) and Order 3 would
disappear from the list.

In order to eliminate Order 3 from the list initially, you will need to
add
a subquery to qryInsufficientStock.

Your SQL would look something like this (untested!):

Select OrderDetail.OrderID, OrderDetail.ProductID,
OrderDetail.Qty, OrderDetail.Qty-Inventory.Qty as Required
from Orders inner join (OrderDetails inner join Inventory
on OrderDetails.ProductID=Inventory.ProductID)
on OrderDetails.OrderID=Orders.OrderID
where (Inventory.Qty(Select Sum(Qty) from OrderDetail as D
inner join Orders as O on O.OrderID=D.OrderID where O.Shipped=0
and O.OrderDateOrders.OrderDate));

Okay - I am running into a little trouble. If I have 3 orders each one
has
order qty as an example

[quoted text clipped - 32 lines]

Stock


--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via http://www.accessmonster.com



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.