Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

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')
0
al4629740
Asked:
al4629740
  • 2
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
select * from attendancegrid
where Activity = 'A&C-Arts & Crafts   1' And [CSW/TitleXX] = 'T'
And  (Month = 'October' Or Month = 'November' Or Month = 'December')
0
 
Philip PinnellCommented:

 {Month = 'October' Or Month = 'November' Or Month = 'December')
should be
(Month = 'October' Or Month = 'November' Or Month = 'December')




~
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
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')
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now