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

The Archive Base Latest Questions

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

My problem is when user selects same dates, query below returns empty array. Instead

  • 0

My problem is when user selects same dates, query below returns empty array. Instead when user selects same dates, it has to show users created at that date. Any help will be appreciated.

User.where("created_at >= ? and created_at =< ?", params[:from].to_date, params[:to].to_date)
  • 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-23T14:26:09+00:00Added an answer on May 23, 2026 at 2:26 pm

    You are probably using DATETIME database columns. The problem is that the user selects “from” as (for example) 2011-07-09 and for the comparison the database translates that to “2011-07-09 00:00:00” and if the user selects the same day twice, there will probably be no results (unless they were exactly created at “2011-07-09 00:00:00”). To fix this, just do

    to_date = params[to].to_date + 1.day
    

    before making the actual database search call. And use to_date instead of params[:to].to_date

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

Sidebar

Related Questions

I've got a problem on a WebForms application where a user selects some criteria
This problem is baffling me: BEGIN; INSERT INTO sub_users(user_id, email) SELECT user_id FROM users
I have a bit of a problem with user controls. Basically what I want
I am trying to debug a problem where a user clicks on the button
Today, I ran into this weird problem with a user using Mac OS X.
This is inspired by/taken from this thread: http://www.allegro.cc/forums/thread/603383 The Problem Assume the user gives
Problem: Customer X is a Windows user who wants to be able to trigger
Problem: EmacsW32 is a version of Emacs that allows the user to make Emacs
My problem is that I have a user that is having a problem displaying
I have a problem with the MySQL root user in My MySQL setup, and

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.