Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Multiple WHERE clauses

$
0
0

Greetings everyone,

I was struggling with a question I was hoping someone could help with...

I am trying to query a database using a select query and want to filter the results to only show me records between certain dates and when a specific values appear in another field.

I am do each on their own by cannot seem to combine the two here is my code that doesn't work...

select * from sdfd.MSF228
where CURR_DUE_DATE between 20140515 and 20140522
AND 
PREQ_STK_CODE =         007191010       OR
PREQ_STK_CODE =   007191010  OR
PREQ_STK_CODE =   009662316  OR
PREQ_STK_CODE =   007191015  OR
PREQ_STK_CODE =   007160066  OR
PREQ_STK_CODE =   007160039  OR
PREQ_STK_CODE =   009663310  OR
PREQ_STK_CODE =   007160076  OR
PREQ_STK_CODE =   007180076  OR
PREQ_STK_CODE =   007180004  OR
PREQ_STK_CODE =   007180006  

 Can anyone help please?

Thanks,

Pete


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>