If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > To join more where conditions with in a field

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-28-11, 10:20
sivavem sivavem is offline
Registered User
 
Join Date: Jun 2011
Posts: 2
To join more where conditions with in a field

Could you please correct me? Thanks

SELECT Customer.dbo.Store.Store, Customer.dbo.Store.names, Customer.dbo.Store.address,Customer.dbo.Store.epos group,
Customer.dbo.Store.scandate, Customer.dbo.Store.Vendor , --CONVERT(CHAR(8),Customer.dbo.Store.lastupdate,3) as 'Last UpDate',
Customer.dbo.Store.refusal, eposdata.dbo.ProcStatusTY.ProcStatus
FROM eposdata.dbo.ProcStatusTY, Customer.dbo.Store
WHERE eposdata.dbo.ProcStatusTY.WeekNumber = 24
--AND Customer.dbo.Store.Vendor = 'leaders'
AND Customer.dbo.Store.Vendor != 'cbe' , 'leaders', 'merit'
ORDER BY eposdata.dbo.ProcStatusTY.ProcStatus desc
Reply With Quote
  #2 (permalink)  
Old 06-29-11, 07:16
piyush sachan piyush sachan is offline
Registered User
 
Join Date: Jun 2011
Location: Noida,kanpur (India)
Posts: 2
Thumbs down Pks

Quote:
Originally Posted by sivavem View Post
Could you please correct me? Thanks

SELECT Customer.dbo.Store.Store, Customer.dbo.Store.names, Customer.dbo.Store.address,Customer.dbo.Store.epos group,
Customer.dbo.Store.scandate, Customer.dbo.Store.Vendor , --CONVERT(CHAR(8),Customer.dbo.Store.lastupdate,3) as 'Last UpDate',
Customer.dbo.Store.refusal, eposdata.dbo.ProcStatusTY.ProcStatus
FROM eposdata.dbo.ProcStatusTY, Customer.dbo.Store
WHERE eposdata.dbo.ProcStatusTY.WeekNumber = 24
--AND Customer.dbo.Store.Vendor = 'leaders'
AND Customer.dbo.Store.Vendor != 'cbe' , 'leaders', 'merit'
ORDER BY eposdata.dbo.ProcStatusTY.ProcStatus desc
Solution::
first of all there should be common column for join in both table like(Customer.dbo.Store.ID=eposdata.dbo.ProcStatus TY.ID)
than
use this--> Customer.dbo.Store.Vendor in( 'cbe' , 'leaders', 'merit')<-- in place of ..
Customer.dbo.Store.Vendor != 'cbe' , 'leaders', 'merit'

Last edited by piyush sachan; 06-29-11 at 07:23.
Reply With Quote
  #3 (permalink)  
Old 06-29-11, 14:38
sivavem sivavem is offline
Registered User
 
Join Date: Jun 2011
Posts: 2
Piyush, thanks for that. Still not working
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On