I'm working on a web-based club membership system for the small swim club that I manage. Database is SQL Server 2012.
My table looks like this:
visitid (int, pk)
memberid (int, fk)
memberfamilyid (int, fk) (mildly redundant but stored for ease of access to data by family)
visitdatetime (datetime)
guest (bit) (members can bring guests)
If I wanted to return a result set that would have the number of visitors (memberid) and the number of guests, along with the date for each day, what might that look like?
I'm thinking this would be the output:
Thanks,
Pete
My table looks like this:
visitid (int, pk)
memberid (int, fk)
memberfamilyid (int, fk) (mildly redundant but stored for ease of access to data by family)
visitdatetime (datetime)
guest (bit) (members can bring guests)
If I wanted to return a result set that would have the number of visitors (memberid) and the number of guests, along with the date for each day, what might that look like?
I'm thinking this would be the output:
Code:
Date Visits Guests
5/25/2014 65 12
5/24/2013 38 3
Thanks,
Pete