Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 OR statement

Author  Topic 

ClaudioSissa
Starting Member

1 Post

Posted - 2013-01-10 : 19:56:27
I have difficulties with the OR/AND syntax.Any suggestions? My code is below

PROC SQL;
CREATE TABLE WORK.FILTER_FOR_FACSCI_2003_ONWARDS_1 AS
SELECT t1.proposal_status_description,
t1.ci_last_name,
t1.institution_number,
t1.primary_associated_dept_code,
t1.category,
t1.award_period_start_date,
t1.award_period_end_date,
t1.award_period_direct_cost
FROM WORK.FACSCI_2003_ONWARDS_17122012 t1
WHERE t1.primary_associated_dept_code = ('BABS'OR 'SCIAD')
QUIT;

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2013-01-10 : 21:08:58
Use IN keyword
WHERE t1.primary_associated_dept_code IN ('BABS','SCIAD')
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-10 : 22:31:07
is this t-sql? QUIT is not t-sql command

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -