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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:56:41+00:00 2026-05-12T23:56:41+00:00

When adding the line: LEFT JOIN core_records_sales as sales ON DATE(appointments.date) = DATE(sales.date_sold) To

  • 0

When adding the line:

LEFT JOIN core_records_sales as sales ON DATE(appointments.date) = DATE(sales.date_sold)

To my query, it boosts the time for the script to run from about 8 seconds, to 2-3 minutes.

Would there be some data causing this problem or am I not implementing the function correctly?

I need to use DATE() because I need them to be the same day but the date fields are DATETIME

  • 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-12T23:56:41+00:00Added an answer on May 12, 2026 at 11:56 pm

    This is almost certainly an issue with the appointments.date field being indexed. Adding the use of the DATE() function makes it so that index cannot be used, forcing a table scan.

    I’ve had to deal with this before, and the best way I’ve found to solve the issue is to have a separate column with just the date part (no time) in it or to store the date and time in two separate columns.

    I’d love to hear if others have a better way of dealing with that though.

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

Sidebar

Related Questions

I've tried everything from adding line-height, to changing the 'display' property to 'table-cell' to
I have an existing app with a command-line interface that I'm adding a GUI
What are your opinions on developing for the command line first, then adding a
I have a complex query and it was working fine before adding one more
I need to execute Javascript from an external javascript library (which I left in
I would like to call an R script from Java. I have done google
I need to 'manufacture' records for a query, but at the same time, restrict
SELECT * FROM left_table OUTER JOIN right_table on left_table.name = righ t_table.name; SELECT *
I'm trying to match up two bits of data, adding to an existing query.
I'm adding values from an ArrayList of Strings to a BST and I'm coming

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.