Results 1 to 15 of 15

sql left function

Threaded View

  1. #15
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London, England
    MS-Off Ver
    EXCEL 2013
    Posts
    324

    Re: sql left function

    Hi Kyle further to your knowledge

    I have changed the forumla to (see below) and it seems to be running perfectly fine now . Thank you for your support .

    Regards

    D


    PHP Code: 
    SELECT sub.*, 
           case 
    when rm_sales_band '2M to 4M' then 'Kirsty' else RM end as rm
    into 
    #rmtmp
    FROM   
    (SELECT[fdmsaccountno], 
                  [
    ho], 
                  [
    rm_sales_band], 
                  [
    rm_code], 
                  [
    post_code], 
                  CASE 
                    
    WHEN Isnumeric(RIGHT(LEFT(post_code2), 1)) = '0' THEN 
                    LEFT
    (post_code2
                    ELSE 
    LEFT(post_code1
                  
    END AS 'sPostcode'
                  [
    mcc_code
            
    FROM   [FDMS].[dbo].[dim_outlet
            
    WHERE  [rm_sales_band]IN '2M to 4m''4m +' 
                   AND [
    ho] = 'Y' 
                   
    AND rm_code 'na' 
                   
    AND iso_account 'N' 
                   
    AND fdmsaccountno NOT IN (SELECT [ta_mid
                                             
    FROM 
                       fdms_partnerreporting
    .tmp.trade_assocations)) Sub 
           INNER JOIN 
    [geo_pca_sellers
                   
    ON [pca] = spostcode 
    Last edited by Cutter; 08-02-2012 at 04:46 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1