January 24, 2012 at 1:48 pm
I am beginning to doubt my knowledge of sql. seems i can not even write a simple query.
select count(member_number), member_time.date
from member_time
where member_time.date >=convert(date,DATEADD(dd,-1,GETDATE())) and member_time.date <=convert(date,dateadd(dd,-7,getdate())
group by member_time.date
tells me that there is a syntax error near group. i have moved group between from and where and still error.
January 24, 2012 at 2:17 pm
bill.akin (1/24/2012)
I am beginning to doubt my knowledge of sql. seems i can not even write a simple query.select count(member_number), member_time.date
from member_time
where member_time.date >=convert(date,DATEADD(dd,-1,GETDATE())) and member_time.date <=convert(date,dateadd(dd,-7,getdate())
group by member_time.date
tells me that there is a syntax error near group. i have moved group between from and where and still error.
Try this:
select count(member_number), member_time.date
from member_time
where member_time.date =convert(date,DATEADD(dd,-1,GETDATE()))
and member_time.date =convert(date,dateadd(dd,-7,getdate()))
group by member_time.date
You were missing a ) directly before GROUP BY and after getdate())
Jared
CE - Microsoft
January 24, 2012 at 2:24 pm
that did the trick did not have enough parens.
thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply