SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 OR statement
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ClaudioSissa
Starting Member

1 Posts

Posted - 01/10/2013 :  19:56:27  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

5155 Posts

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

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 01/10/2013 :  22:31:07  Show Profile  Reply with Quote
is this t-sql? QUIT is not t-sql command

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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000