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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:36:28+00:00 2026-06-09T23:36:28+00:00

I have following mysql tables. 1. members ———- |id |name| ———- |001|aaa | |002|bbb

  • 0

I have following mysql tables.

1. members
----------
|id |name|
----------
|001|aaa |
|002|bbb |
|003|ccc |
|004|ddd |
----------

2. membershipfees
----------------
|id |date      |
----------------
|001|2012-01-01|
|002|2012-01-01|
----------------

I want to show list of the members who not paid the fees for the current month. My php code is,

SELECT Members.id, Members.Name FROM Members
    LEFT JOIN MembershipFees
    ON Members.id = MembersipFees.id
    WHERE DATE_FORMAT(MembershipFees.Date, '%Y%m') <> DATE_FORMAT(NOW(), '%Y%m')
    ORDER BY Members.id ASC

But it shows 0 rows. Any suggestions please.

  • 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-09T23:36:30+00:00Added an answer on June 9, 2026 at 11:36 pm

    You need to put MembersipFees.id IS NULL condition is where clause. Also if date field is varchar column then you should be using STR_TO_DATE function.

    SELECT Members.id, Members.Name
    FROM Members
         LEFT JOIN membershipfees
            ON Members.id = membershipfees.id
               AND DATE_FORMAT(STR_TO_DATE(membershipfees.`Date`, '%d-%m-%Y'), '%Y%m') = 
                               DATE_FORMAT(NOW(), '%Y%m')
    WHERE membershipfees.id IS NULL
    ORDER BY Members.id ASC;
    

    SEE SQLFIDDLE DEMO HERE

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following two tables in my mysql database. Table Name: groups id
I have following mysql database tables: cities states countries with members samajs (a group
I have the following tables in MySQL server: Companies: - UID (unique) - NAME
I have the following MySQL tables (Simplified) DRIVER (D) ---------- id (PK) name RACE
I have the following destination , image and destination_image tables: (MYSQL): destination: id_destination image:
I have 2 mysql tables : Question with the following columns : id, question,
I have 2 mysql tables 1. questions: with the following columns: id, title, answer1,
I have three mysql table from same database Db1. Three tables have following columns.
In one of my MySQL tables, I have following columns: Skills varchar(80) Industry varchar(40)
Suppose I have the following two tables in my MySQL database: Table 1:: EMP:

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.