SQL Query Help - 2 Queries
Hi all
Got a problem with a query, not sure what command to use, Tried and tried, now trying a union but its not giving me what I want
Basically for example, I want a count of customers that created their account (CreatedDate) in Nov 13, and then the next column to look of the customers that created an account, fully registered in or 21 days after the month (RegisteredDate)
So first column need a count of CreatedDate 1-11-2013 to 30-11-2013
then of those who registered RegisteredDate between 1-11-2013 - 21-12-2013
Here is what I have gotten to
Select Date_Format(PlayerAccounts.CreatedDate,"%M,%Y"), AffiliateName,
Count(CreatedDate), Count(RegisteredDate)
from PlayerAccounts, Affiliates
Where
PlayerAccounts.AffiliateID = Affiliates.AffiliateID
and CreatedDate Between "2013-11-01" and "2013-12-01"
Union
Select
Date_Format(PlayerAccounts.CreatedDate,"%M,%Y"), AffiliateName,
Count(CreatedDate), Count(RegisteredDate)
from PlayerAccounts, Affiliates
Where
PlayerAccounts.AffiliateID = Affiliates.AffiliateID
and CreatedDate Between "2013-11-01" and "2013-12-01"
and RegisteredDate between "2013-11-01" and "2013-12-22"
Group By AffiliateName
Would be very greatful for any help
Thanks
Craig