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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:09:31+00:00 2026-05-26T10:09:31+00:00

SELECT table1.id From table1 Join table2 ON table1.id = table2.id WHERE table1.`date` BETWEEN CURDATE()

  • 0
SELECT

table1.id

From 
table1
Join 
table2
ON 
table1.id = table2.id 

WHERE 
table1.`date` BETWEEN CURDATE() - INTERVAL 1 MONTH AND CURDATE();

join table record set is

id  customer    date
1   john        2011-01-01
2   john1       2011-02-02
3   john2       2011-03-03
4   john3       2011-04-04
5   john4       2011-05-05
6   john5       2011-06-06
7   john6       2011-07-07
8   john7       2011-08-08
9   john8       2011-09-09
10  john9       2011-10-10
11  john10      2011-10-11

I was wondering if this is the right where clause to find if the customer that has a date over 30 days due.

  • 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-26T10:09:32+00:00Added an answer on May 26, 2026 at 10:09 am
    WHERE 
    table1.`date` BETWEEN CURDATE() - INTERVAL 1 MONTH AND CURDATE() ;
    

    will give you all rows with date between today and one month ago. If that’s what you want, keep the query.

    If you want all rows with date older than one month ago, use this:

    WHERE 
    table1.`date` < CURDATE() - INTERVAL 1 MONTH ;    
    

    or this (not exactly the same results with previous):

    WHERE 
    table1.`date` < CURDATE() - INTERVAL 30 DAY ;   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whats the difference between SELECT DISTINCT field1 FROM table1 cd JOIN table2 ON cd.Company
Given a query like: SELECT table1.field1 FirstField, table2.field2 SecondField FROM table1 INNER JOIN table2
Given these two queries: Select t1.id, t2.companyName from table1 t1 INNER JOIN table2 t2
My query string is like: SELECT ... FROM maintable LEFT JOIN table1 on (maintable.id
I have 2 tables, using an inner join to query them. SELECT COUNT(table2.id) FROM
SELECT * FROM TableA INNER JOIN TableB ON TableA.name = TableB.name SELECT * FROM
i'm joining tables like: select * from tableA a full join tableB b on
I've seen people writing the following query SELECT column_name(s) FROM table_name1 LEFT JOIN table_name2
How to select all columns from tables in join using linq Sql: select CTRL_RUN_JOB.*,
Is this equivalent to a LEFT JOIN ? SELECT DISTINCT a.name, b.name FROM tableA

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.