Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Syntax problem - Msg 4145 Expand / Collapse
Author
Message
Posted Monday, June 14, 2010 1:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 17, 2010 4:49 AM
Points: 5, Visits: 6
I wrote this code :

select Name, count(ID)
from Players Join Brands on PlayerID
where UnsubscribeDate between '2009-01-01' and '2010-01-01'
group by ID, Name

and i get this error message:

Msg 4145, Level 15, State 1, Line 3
An expression of non-boolean type specified in a context where a condition is expected, near 'where'.

tried to rap my head around it, could use some help..

thanks.
Post #936633
Posted Monday, June 14, 2010 1:54 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 1:57 AM
Points: 1,949, Visits: 8,304
best guess..

this...
from Players Join Brands on PlayerID 


should be

from Players Join Brands on Players.PlayerID = Brands.PlayerId 

HTH




Clear Sky SQL
My Blog
Kent user group
Post #936639
Posted Tuesday, June 15, 2010 12:56 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 17, 2010 4:49 AM
Points: 5, Visits: 6
It works, thanks :)
Post #937271
Posted Tuesday, June 15, 2010 2:10 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 1:57 AM
Points: 1,949, Visits: 8,304
Good stuff.

Hope you understand your mistake.




Clear Sky SQL
My Blog
Kent user group
Post #937301
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse