Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7565515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:10:30+00:00 2026-05-30T14:10:30+00:00

If anyone could help me join these two selects together to create one mega

  • 0

If anyone could help me join these two selects together to create one mega statement that would be awesome!!

–running against quotingSystem database

SELECT 
    CONVERT (varchar, Quote.QuoteID) AS QuoteID, Quote.FirstName, 
    Quote.LastName, Quote.ProductSKU, Quote.ProductID, Quote.Quantity, 
    Quote.CreationDate, 
    CONVERT (CHAR(8), Quote.CreationTime, 8) AS CreationTime, 
    Quote.CompanyName, 
    IncommingQuoteStatus.StatusDesc, Quote.LockedDateTime, 
    Users.FirstName + ' ' + Users.LastName AS UserName 
FROM 
    Quote 
INNER JOIN 
    IncommingQuoteStatus ON IncommingQuoteStatus.StatusID = Quote.Status 
INNER JOIN 
    Users ON Quote.LockedUserID = Users.UserID 
WHERE 
    (Quote.Status > 2 AND Quote.Status < 6) 
ORDER BY 
    QuoteID DESC

— running on quoting system database but also pulling in values from another database CBretailDB

select 
     D2.stock AS CurrentStock
from 
     dbo.Quote as D1 
inner join 
     CBretailDB.dbo.products AS D2 ON D1.ProductID = D2.idProduct

the Quote.ProductID on the first statement needs to join on the D2.idProduct from second statement to pull the CurrentStock value

I think that makes sense!

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:10:31+00:00Added an answer on May 30, 2026 at 2:10 pm

    Try this:

    SELECT CONVERT (varchar, Quote.QuoteID) AS QuoteID, Quote.FirstName, Quote.LastName, 
    Quote.ProductSKU, Quote.Quantity, Quote.CreationDate, CONVERT (CHAR(8), 
    Quote.CreationTime, 8) AS CreationTime, Quote.CompanyName, 
    IncommingQuoteStatus.StatusDesc, Quote.LockedDateTime, Users.FirstName + ' ' + 
    Users.LastName AS UserName, D2.stock FROM Quote INNER JOIN IncommingQuoteStatus ON 
    IncommingQuoteStatus.StatusID = Quote.Status INNER JOIN Users ON Quote.LockedUserID = 
    Users.UserID 
    INNER JOIN CBretailDB.dbo.products AS D2 ON Quote.ProductID = D2.idProduct
    WHERE (Quote.Status > 2 AND Quote.Status < 6) ORDER BY QuoteID DESC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have these two queries, that i want to join together, but am not
Does anyone have any tips that could help speed up a process of breaking
I was wondering if anyone could help me animate an image on hover that
I wonder if anyone could help me with a problem I've been having. I
OK, if anyone could help me with this I'd be much appreciative. If you
Hey there, was wondering if anyone could help a newbie on SQL and Python.
Could anyone help me to understand following line of code: sol< ?=f((1<< n)-1,i,0)+abs(P[i])*price; I
Ok so could anyone please help me out with the VB for auto entering
I need to get substed drive letter in Perl. Could anyone kindly help me?
Could anyone please tell how jre directory help in the running java programs? I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.