Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference two Databases and getting this error..... 1

Status
Not open for further replies.

AuctionLamb

Programmer
Feb 16, 2005
65
ZA
Hi Guys!!

Need some SQL help over here..... I am referencing two databases but get a error on the OnlineOrders database? Why?

Here is my SQL code:

SELECT top 20 QUOTES.dQuote_Date AS QuoteDate, JOBS.dDue_Date AS DueDate, JOBS.CUST_PO_NUM AS PRNumber, OO.insertedDate AS GoodsReceivedDate
FROM JOBS
INNER JOIN QUOTES
ON JOBS.FK_iQuote_id = QUOTES.PK_iQuote_id
INNER JOIN dbo.Staging.OnlineOrders OO
ON JOBS.CUST_PO_NUM = OO.jobNr

The error I am getting is:

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.Staging.OnlineOrders'.

How Do I fix this? Help would much be appriacated!

THANKS!!
 
try

Code:
SELECT top 20 QUOTES.dQuote_Date AS QuoteDate, JOBS.dDue_Date AS DueDate, JOBS.CUST_PO_NUM AS PRNumber, OO.insertedDate AS GoodsReceivedDate
FROM dbo.JOBS
INNER JOIN QUOTES
    ON JOBS.FK_iQuote_id = QUOTES.PK_iQuote_id
INNER JOIN Staging.dbo.OnlineOrders OO
    ON JOBS.CUST_PO_NUM = OO.jobNr

"I'm living so far beyond my income that we may almost be said to be living apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top