Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2011
    Posts
    2

    Unanswered: 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

  2. #2
    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 08:23.

  3. #3
    Join Date
    Jun 2011
    Posts
    2
    Piyush, thanks for that. Still not working

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •