+ Reply to Thread
Results 1 to 15 of 15

sql left function

Hybrid View

masond3 sql left function 08-01-2012, 03:13 PM
K m Re: sql left function 08-01-2012, 03:20 PM
masond3 Re: sql left function 08-01-2012, 03:26 PM
K m Re: sql left function 08-01-2012, 03:29 PM
masond3 Re: sql left function 08-01-2012, 03:38 PM
Kyle123 Re: sql left function 08-02-2012, 03:46 AM
masond3 Re: sql left function 08-02-2012, 03:53 AM
Kyle123 Re: sql left function 08-02-2012, 03:54 AM
masond3 Re: sql left function 08-02-2012, 04:22 AM
Kyle123 Re: sql left function 08-02-2012, 04:28 AM
masond3 Re: sql left function 08-02-2012, 04:38 AM
Kyle123 Re: sql left function 08-02-2012, 07:40 AM
masond3 Re: sql left function 08-02-2012, 07:53 AM
Kyle123 Re: sql left function 08-02-2012, 07:54 AM
masond3 Re: sql left function 08-02-2012, 09:58 AM
  1. #1
    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

+ Reply to Thread

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