return count by individual days

  • Hi i am using the followig query :

    select count (*) from MEMBERS,dbo.MEMBER_PROFILE

    where MEMBER_PROFILE.member_no = members.member_no

    AND JOIN_DATE between '07-01-2013 00:01' and '07-31-2013 11:59'

    and email <> 'selfbuy_customer@cafepress.com'

    and ROOT_FOLDER_NO is not null

    and email not like '%bvt.bvt'

    This returns the count for the month but I want to see what the total each day was.

    Thanks

    George

  • Add JOIN_DATE to the Select list and a group by:

    select JOIN_DATE , count (*) from MEMBERS,dbo.MEMBER_PROFILE

    where MEMBER_PROFILE.member_no = members.member_no

    AND JOIN_DATE between '07-01-2013 00:01' and '07-31-2013 11:59'

    and email <> 'selfbuy_customer@cafepress.com'

    and ROOT_FOLDER_NO is not null

    and email not like '%bvt.bvt'

    GROUP BY JOIN_DATE

  • Thanks Loudclear but the count returns as 1 need the count sum for each day

  • sum is probably incorrect what I need is the total for each day

  • If you provide your table structure, some sample data and your expected results, I could help you better.

    See some guidance on providing this kind of thing here:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Thanks for the response but i used cast(convert(char(10),JOIN_DATE,121) as date) as day in query and got the resluts i was looking for

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply