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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:35:44+00:00 2026-06-04T21:35:44+00:00

=> #<Gig id: 59, date: 2012-06-01 00:00:00, title: Awesome Record, url: http://someurl.com, body: nil,

  • 0
=> #<Gig id: 59, date: "2012-06-01 00:00:00", title: "Awesome Record", url: "http://someurl.com", body: nil, reply_email: nil, industry_id: nil, created_at: "2012-06-03 03:06:45", updated_at: "2012-06-03 03:06:45"> 


1.9.2-p0 :046 > Gig.where(:date => "2012-06-01 00:00:00")
  Gig Load (0.3ms)  SELECT "gigs".* FROM "gigs" WHERE "gigs"."date" = '2012-06-01 00:00:00'
 => [] 
1.9.2-p0 :043 > Gig.where(:date => "2012-06-01")
  Gig Load (0.3ms)  SELECT "gigs".* FROM "gigs" WHERE "gigs"."date" = '2012-06-01'
 => [] 
1.9.2-p0 :044 > Gig.where(:date => "June 01")
  Gig Load (0.6ms)  SELECT "gigs".* FROM "gigs" WHERE "gigs"."date" = 'June 01'
 => [] 
1.9.2-p0 :045 > Gig.where(:date => "June 1")
  Gig Load (32.9ms)  SELECT "gigs".* FROM "gigs" WHERE "gigs"."date" = 'June 1'
 => [] 

All I am trying to do is find the records in this table that have a specific ‘date’ (or even records that fall within a date range). But the basic where clause above won’t work.

What am I doing wrong?

Edit 1

I outputted the date as string, via to_s and this is the output:

d.date
 => Fri, 01 Jun 2012 00:00:00 UTC +00:00 
1.9.2-p0 :079 > d.date.to_s
 => "2012-06-01 00:00:00 UTC" 

Not sure if that will help….but I even tried including those strings as the condition of the where clause and it still returns an empty array.

  • 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-04T21:35:45+00:00Added an answer on June 4, 2026 at 9:35 pm

    Try these:

    Gig.where(:date => "2012-06-01 00:00:00 +00.00")
    Gig.where("date like '2012-06-01%'")
    Gig.where("DATE(date) = '2012-06-01'")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At my new gig, they use Ant and cannot be persuaded to move to
Below I present you some code which has completely been butchered by me. $(.gig).hover(function()
Like really really slow. I've got a 64 bit, 8 cores, 12 gig ram
Ok so my new gig is high performance video (think Google streetview but movies)
I'm on a short-term contracting gig, trying to patch some vulnerabilities in their legacy
How can i get a particular line in a 3 gig text file. The
How can I get a particular line in a 3 gig text file. All
I have a Kingston Datatraveller Vault privacy edition with 8 GIG of space and
Given a really large, 3+ gig, binary file is there anyway that I could
My google foo is failing me... I have a file (well over 2 gig's)

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.