Hi, I''m having some records with a start- and end-date: 1. start= 01/03/2007 end 05/05/2007 2. start= 01/04/2007 end 20/06/2007 3. start= 15/07/2007 end 01/08/2007 How can I query the records that lie in a specific month? I need for example all records that occur in the month may (05). So if a record starts on 01/03/2007 and ends on 05/05/2007 => it lies in the month may But the 2nd record also lies in the month may! It starts on 01/04/07 and ends on 20/06/07 The third record doesn''t occur in the month may Any help would be welcome :). It looks simple, but it''s driving me nuts Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Maarten Porters wrote:> Hi, > > I''m having some records with a start- and end-date: > > 1. start= 01/03/2007 end 05/05/2007 > 2. start= 01/04/2007 end 20/06/2007 > 3. start= 15/07/2007 end 01/08/2007 > > How can I query the records that lie in a specific month? > > I need for example all records that occur in the month may (05). > > So if a record starts on 01/03/2007 and ends on 05/05/2007 => it lies in > the month may > > But the 2nd record also lies in the month may! It starts on 01/04/07 and > ends on 20/06/07 > > The third record doesn''t occur in the month may > > Any help would be welcome :). It looks simple, but it''s driving me nuts > > Thanks >something like: start_date <= end_of_may and end_date >= start_of_may? sorry for the lack of code - it''s 3:30AM and my brain''s left for the night! Cheers, Mohit. 9/26/2007 | 3:28 AM. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jezus ... I feel stupid :) Works great... Thanks a lot! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Maarten Porters wrote:> jezus ... I feel stupid :) Works great... Thanks a lot! >Glad to help. Cheers, Mohit. 9/26/2007 | 10:38 PM. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---