------第一种返回总数-----
select count(date)as '总数' from (
select convert(varchar(10),a.regdate,112) as date from userinfo a inner join dbo.UserInfoDetail b
on a.userid=b.userid where b.parentuserid=1 and a.regdate between
'2010-12-17 00:00:00' and '2012-12-19 00:00:00' group by convert(varchar(10),a.regdate,112)) a
----第二种返回条数-------
select convert(varchar(10),a.regdate,112) as date,* from userinfo a inner join dbo.UserInfoDetail b
on a.userid=b.userid where b.parentuserid=1 and a.regdate between
'2010-12-17 00:00:00' and '2012-12-19 00:00:00'