al4629740
asked on
Query error - please check statement
Is there anything wrong with this query:
select * from attendancegrid where Activity = 'A&C-Arts & Crafts 1' And [CSW/TitleXX] = 'T' And {Month = 'October' Or Month = 'November' Or Month = 'December')
select * from attendancegrid where Activity = 'A&C-Arts & Crafts 1' And [CSW/TitleXX] = 'T' And {Month = 'October' Or Month = 'November' Or Month = 'December')
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
also its a better practice to enclose the 'month' in square brackets, like this [month]
select * from attendancegrid
where Activity = 'A&C-Arts & Crafts 1' And [CSW/TitleXX] = 'T'
And [Month] IN ( 'October' ,'November' ,'December')
select * from attendancegrid
where Activity = 'A&C-Arts & Crafts 1' And [CSW/TitleXX] = 'T'
And [Month] IN ( 'October' ,'November' ,'December')
{Month = 'October' Or Month = 'November' Or Month = 'December')
should be
(Month = 'October' Or Month = 'November' Or Month = 'December')
~