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
 SQL Server 2012 Forums
 Transact-SQL (2012)
 And Or Operator
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ozandalkiran
Starting Member

Turkey
10 Posts

Posted - 04/10/2014 :  05:09:02  Show Profile  Reply with Quote
Hi
i wanna write many and or operator.
but when i wrote below code date interval nor working
may u help me pls

convert(varchar(10),[CreateDate],104) as CreateDate
,[StatusCode]
,[MainCompanyLicenseCode]
,SST.SpecialStatusTypeName
,SS.Description
,[EPDKLicenseCode]
,[StationID]
,[DealerID]
,[EPDKProductNameID]
,[EPDKProductName]
,[ProductID]
,[StartDateTime]
,[EndDateTime]
,[SpecialStatusTypeID]
,[Missing]
,[Gain]
,[Status]
,[Approve]
,[IsSent]
,[StatusInfo]
,[CreatedBy]
,[CreationTime]
,[UpdatedBy]
,[UpdatedTime]
,[UpdateSource]
,[UpdatedByID]
,[IsManuel]
,[Missing_Bk]
,[Gain_Bk]
,[EPDKDescriptionID]
,[EpdkTableNumber]
,[EpdkSpecialStatusResponsiblesID]
,[Flag]
FROM [PUMPOMAT_HO].[dbo].[EPDK_Table08_SpecialStatus] SS
inner join EPDK_SpecialStatusTypes SST
on
SS.SpecialStatusTypeID = SST.RID
where
CreateDate between '20140101' and '20140409' and
EpdkTableNumber =1 and SS.Description like '%1%tank%' or SS.Description like '%2%tank%' or
SS.Description like '%3%tank%' or SS.Description like '%4%tank%' or
SS.Description like '%5%tank%' or SS.Description like '%6%tank%'

khtan
In (Som, Ni, Yak)

Singapore
17595 Posts

Posted - 04/10/2014 :  05:41:58  Show Profile  Reply with Quote
where CreateDate between '20140101' and '20140409' 
and   (
          EpdkTableNumber =1 and SS.Description like '%1%tank%' 
      or  SS.Description like '%2%tank%' 
      or  SS.Description like '%3%tank%' 
      or  SS.Description like '%4%tank%' 
      or  SS.Description like '%5%tank%' 
      or  SS.Description like '%6%tank%'
      )



KH
Time is always against us

Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22754 Posts

Posted - 04/10/2014 :  06:44:17  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
or simply

where 
CreateDate between '20140101' and '20140409' and
EpdkTableNumber =1 and SS.Description like '%[123456]%tank%' 


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

ozandalkiran
Starting Member

Turkey
10 Posts

Posted - 04/10/2014 :  07:02:39  Show Profile  Reply with Quote
thank you

quote:
Originally posted by madhivanan

or simply

where 
CreateDate between '20140101' and '20140409' and
EpdkTableNumber =1 and SS.Description like '%[123456]%tank%' 


Madhivanan

Failing to plan is Planning to fail

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.05 seconds. Powered By: Snitz Forums 2000