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 799037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:03:50+00:00 2026-05-14T23:03:50+00:00

I have an Access 2007 database where I have two tables, exp_cash and exp_cheque.

  • 0

I have an Access 2007 database where I have two tables, exp_cash and exp_cheque. Both are linked to exp_cat, where exp_cat contains categories list, and exp_cash and exp_cheque contain id, cat_id, exp_date, exp_amount, and exp_note.

When I tried to combine them nothing appears in the result unless I remove the cat_name from my query. I used a simple query:

SELECT DISTINCT
    exp_cat.cat_name,
    exp_cash.exp_amount,
    exp_cheque.exp_amount
FROM (exp_cat INNER JOIN exp_cash
    ON exp_cat.ID = exp_cash.exp_cat_id)
    INNER JOIN exp_cheque
    ON exp_cat.ID = exp_cheque.exp_cat_id;

Table exp_cat contains

exp_cat_name
exp_cat_id

    exp_cat_id ----- exp_cat_name
        1      -----    Salary
        2      -----    Electricity
        3      -----    Water Bill
        4      -----    Loan

Table exp_cash contains

exp_cash_id
exp_date
exp_cat_id
exp_cash_amount
exp_invoice_no
    exp_cash_id ----- exp_date ---- exp_cat_id ---- exp_cash_amount ---- exp_invoice_no
        1      -----  15/05/2010 --   2        ----  200            ----   25AB5245
        2      -----  17/05/2010 --   1        ----  50             ----   58624AA

Table exp_cheue contains

exp_cheque_id
exp_date
exp_cat_id
exp_cheque_amount
exp_invoice_no

    exp_cheque_id ----- exp_date ---- exp_cat_id -- exp_cheque_amount -- exp_invoice_no
        1      -----  15/05/2010 --   3          --  120              --   25AB5245
        2      -----  17/05/2010 --   4          --  500              --   58624AA
  • 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-14T23:03:51+00:00Added an answer on May 14, 2026 at 11:03 pm

    I think what you want is left joins instead of inner joins:

    SELECT exp_cat.exp_cat_name, 
           exp_cheque.exp_cash_amount, 
           exp_cash.exp_cheque_amount
    FROM (exp_cat LEFT JOIN exp_cash 
            ON exp_cat.exp_cat_id = exp_cash.exp_cat_id) 
        LEFT JOIN exp_cheque 
            ON exp_cat.exp_cat_id = exp_cheque.exp_cat_id;
    

    Otherwise you must have the same exp_cat_id in both the exp_cash and exp_cheque tables.
    The Inner joins only show what exists in both tables. The left join shows everything in the left table, and anything that happens to match in the right hand table (or null values if nothing matches).

    Here’s what I get when I run that query with your data:

    exp_cat_name   exp_cash_amount   exp_cheque_amount
    ------------   ---------------   -----------------
    Salary                            50
    Electricity                      200
    Water Bill     120
    Loan           500
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Access 2007 and have some linked tables to a mySQL database.
Using MS Access 2007, I am creating a student management database. I have tables
I have a front-end Access 2007 database connecting to MySql tables using MySQL ODBC
I have an access 2007 Database that consists of 3 tables each having 1
I have inherited an Access 2007 database that has been split so the tables
I have an Access 2007 database that has 3 tables, each the same. Each
I have an access 2007 Database that outputs a report in excel format, the
I have an Access 2007 database that works asynchronously with a MAS200 database. Due
I have a table in an Access 2007 database. All fields are of type
I have a database in access 2007 accdb extension , there are more or

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.