D
dorr
I don't have much experience writing SQL queries and am having a hard
time getting my head around this one. I am hoping that someone with
more experience will find this an easy exercise.
I have 3 tables, tblAccounts, tblOrders, and tblQuotes.
tblAccounts:
AcctNumber
AcctName
etc.
tblOrders
OrderDate
BillToAcct
ShipToAcct
etc.
tblQuotes
QuoteDate
BillToAcct
ShipToAcct
etc.
I need a list of all accounts that have been specified as a ShipTo on
an order from the last year, or have been specified as a ShipTo on a
quote from the last year where the BillTo account from either the order
or quote is equal to a known value. The result set needs to contain
information from tblAccounts.
If I am just doing orders or just doing quotes, it is simple. But
having to do both is throwing me off.
Any help in crafting the SQL query would be greatly appreciated.
TIA,
David
time getting my head around this one. I am hoping that someone with
more experience will find this an easy exercise.
I have 3 tables, tblAccounts, tblOrders, and tblQuotes.
tblAccounts:
AcctNumber
AcctName
etc.
tblOrders
OrderDate
BillToAcct
ShipToAcct
etc.
tblQuotes
QuoteDate
BillToAcct
ShipToAcct
etc.
I need a list of all accounts that have been specified as a ShipTo on
an order from the last year, or have been specified as a ShipTo on a
quote from the last year where the BillTo account from either the order
or quote is equal to a known value. The result set needs to contain
information from tblAccounts.
If I am just doing orders or just doing quotes, it is simple. But
having to do both is throwing me off.
Any help in crafting the SQL query would be greatly appreciated.
TIA,
David