Skip to content

Instantly share code, notes, and snippets.

@olvap
Last active December 14, 2015 15:29
Show Gist options
  • Select an option

  • Save olvap/5107959 to your computer and use it in GitHub Desktop.

Select an option

Save olvap/5107959 to your computer and use it in GitHub Desktop.
#Agosto - 2012
irb(main):012:0> AppointmentRequest.where("created_at > '2012-08-01' and created_at < '2012-08-31'").count
(19.3ms) SELECT COUNT(*) FROM `appointment_requests` WHERE (created_at > '2012-08-01' and created_at < '2012-08-31')
=> 543
#Septiembre - 2012
irb(main):011:0> AppointmentRequest.where("created_at > '2012-09-01' and created_at < '2012-09-31'").count
(19.0ms) SELECT COUNT(*) FROM `appointment_requests` WHERE (created_at > '2012-09-01' and created_at < '2012-09-31')
=> 471
#Octubre - 2012
irb(main):010:0> AppointmentRequest.where("created_at > '2012-10-01' and created_at < '2012-10-31'").count
(19.7ms) SELECT COUNT(*) FROM `appointment_requests` WHERE (created_at > '2012-10-01' and created_at < '2012-10-31')
=> 443
#Noviembre - 2012
irb(19.1ms) SELECT COUNT(*) FROM `appointment_requests` WHERE (created_at > '2012-11-01' and created_at < '2012-11-31')
=> 510
#Diciembre - 2012
irb(main):017:0> AppointmentRequest.where("created_at > '2012-12-01' and created_at < '2012-12-31'").count
(19.3ms) SELECT COUNT(*) FROM `appointment_requests` WHERE (created_at > '2012-12-01' and created_at < '2012-12-31')
=> 488
#Enero - 2013
irb(main):014:0> AppointmentRequest.where("created_at > '2013-01-01' and created_at < '2013-01-31'").count
(19.0ms) SELECT COUNT(*) FROM `appointment_requests` WHERE (created_at > '2013-01-01' and created_at < '2013-01-31')
=> 564
#Febrero - 2013
irb(main):015:0> AppointmentRequest.where("created_at > '2013-02-01' and created_at < '2013-02-31'").count
(18.9ms) SELECT COUNT(*) FROM `appointment_requests` WHERE (created_at > '2013-02-01' and created_at < '2013-02-31')
=> 676
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment