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

  • Home
  • SEARCH
  • 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 7973407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:05:33+00:00 2026-06-04T08:05:33+00:00

I have created 2 temp tables and I’m having problems joining them. table #1

  • 0

I have created 2 temp tables and I’m having problems joining them.

table #1

Create Table #First_Pay(
SAID int,
First_Payment date)
select b.CUSTNMBR, min(b.docdate) as first_payment
from RM20101 b
where b.CUSTNMBR = '1973204005'
and b.CHEKNMBR > '1'
Group by b.CUSTNMBR

table #2

Create Table #First_Bil(
SAID int,
First_Bill date)
Select a.CUSTNMBR, MIN(a.Tax_Date) as First_Bill
from SOP30200 as a
where a.CUSTNMBR = '1973204005'
Group by a.CUSTNMBR

and I used this query:

Select a.SAID, a.First_Bill, b.First_Payment
From #First_Bil a 
Full Join
#First_Pay b
On a.SAID = b.SAID;


drop table #First_Bil
drop table #First_Pay

but I’m getting blanks. What am I doing wrong?

  • 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-06-04T08:05:35+00:00Added an answer on June 4, 2026 at 8:05 am

    Instead of just selecting data after creating a temp table you have to insert it into the temp table:

    Create Table #First_Pay(SAID int,
                            First_Payment date)
    
    insert into #First_Pay select b.CUSTNMBR, min(b.docdate) as first_payment
                           from RM20101 b
                           where b.CUSTNMBR = '1973204005'
                           and b.CHEKNMBR > '1'
                           Group by b.CUSTNMBR
    
    Create Table #First_Bil(SAID int,
                            First_Bill date)
    
    insert into #First_Bil Select a.CUSTNMBR, MIN(a.Tax_Date) as First_Bill
                           from SOP30200 as a
                           where a.CUSTNMBR = '1973204005'
                           Group by a.CUSTNMBR
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a table create table #temp(a int, b int, c int) I
I have created one table using the below command: create table Table1( Id int
I have created table #temp with columns id as int identity(1,1) and name as
Two temp tables are created and then loaded...Here's the schema. Create table #SH ([date]
I have created a table like this: CREATE TABLE #TEMP(RecordDate datetime, First VARCHAR(255), Last
I have written a DB2 query to do the following: Create a temp table
I have created a Temp table(#TempTable). I am trying to insert the date to
I created two temp tables, one table is for orders and the other is
We have created one temp-table dynamically . and we want to out put the
I have 2 temp tables that I am populating with a numeric value: CREATE

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.