I have 2 tables: "orders" and "visits". in the orders table i'm saving some details about the order including "userIP" and "orderDate". in the visits table i'm saving details everytime a user visiting my web page including "userIP" and "visitDate". i'm using ASP.NET and SQL SERVER 2005. i want to create a statistic table whitin i save the number of users visited and the number of users that ordered BOTH GROUPED BY DAY so far i got:
select count(userIP) as NumOfOrders,
dateadd(dd, datediff(dd, 0, orderDate),0) as Date
from Orders
group by dateadd(dd, datediff(dd, 0, orderDate), 0)
this works fine and give me the number of orders grouped by day, but how do i add the total visits grouped by day to this?