# Weekly logins

**URL:** <https://www.ruby-forum.com/t/weekly-logins/143998>\
**Category:** Rails\
**Created:** [July 24, 2008, 3:17pm UTC](https://www.ruby-forum.com/t/weekly-logins/143998 "2008-07-24T15:17:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinathbtech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@srinathbtech](https://www.ruby-forum.com/u/srinathbtech)\
**Post date:** [July 24, 2008, 3:17pm UTC](https://www.ruby-forum.com/t/weekly-logins/143998/1 "2008-07-24T15:17:59Z")

</div>

Hi all,  
how to retrieve Number of logins during the week.  
This is the number of times users have logged in last week.  
Say in June 08 if i want the results i should be able retrieve as  
weekly\_logins = [‘june 1 2008 100’,‘june 7 2008 150’, ‘june 14 2008  
210’, ‘june 21 2008 180’…]

My Table for users\_logrecords, columns are  
id,user\_id,login(1-true,0-false),last\_updated  
1 1 1 2008-06-23 23:23:38  
1 1 0 2008-06-23 24:23:30

is there any sql for retreieving the count from particular Month

thanks !!!
