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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:39:05+00:00 2026-05-26T20:39:05+00:00

I have a standard mysql timestamp in this format 2011-11-14 20:06:24 . This timestamp

  • 0

I have a standard mysql timestamp in this format 2011-11-14 20:06:24 . This timestamp will be added whenever a new record is added to the table with the name lead.

I have two input fields for the user to enter from date and to date in dd/mm/yyyy format. Once the user enters both dates and press a button the values will be passsed to other field to get the records from the table lead which are inserted between the time range.

I tried the below query but its not working

SELECT  DATE_FORMAT(added_on, '%d/%m/%Y') as date
FROM    lead
WHERE   added_on BETWEEN "10/11/2011" AND "14/11/2011"
  • 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-26T20:39:06+00:00Added an answer on May 26, 2026 at 8:39 pm

    Use standard format for dates, datetimes and timestamps: '2011-11-14' and not '14/11/2011'.

    Use single quotes, not double quotes.

    If added_on is a timestamp, you should not use BETWEEN or you’ll lose almost all records from the last day because '2011-11-14' will be converted to '2011-11-14 00:00:00'. Use this instead:

    WHERE   added_on >= '2011-11-10'
      AND   added_on <  '2011-11-15'              --- note the "< the next day"
    

    or

    WHERE   added_on >=  '2011-11-10'
      AND   added_on <  ('2011-11-14' + INTERVAL 1 DAY)
    

    You should read carefully the MySQL docs: TIMESTAMP properties page for how timestamps are handled (and auto-inserted, updated) in MySQL and the MySQL docs: Timezone support.

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

Sidebar

Related Questions

In MySQL 4.0.21-standard, I have a table with a date, saved as a string.
I have a standard active record model with an attributes that is required: class
I have a standard store schema with an InvoiceLine table that contains Products. I'd
CF9, Windows Server 2008 Standard, IIS7, mySQL 5.1.48 community. I have managed to get
I'm new to PHP, HTML and MySQL, and have encountered the following problem: I
Please help me rewrite this query from MySQL to SQLite format: SELECT MAX(pubdate) as
Say I have very standard mysql connection code: $dbhost = '192.168.1.99'; $dbuser = 'dbuser';
I have an algorithm written in PHP which communicates with MySQL. On standard shared
I have a primary key in my mysql table which is comprised of three
I have a bog standard MySQL fulltext query as follows: SELECT * FROM accounts

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.