Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Unanswered: Need Convertion to Pervasive SQL

    Hi,

    I am using the below query in Ms-SQL 2005. I want to convert this into Pervasive SQL. This will be appreciated for the proper solution.

    Thanks in advance

    Regards,
    RaaBii

    ************************************************** *******
    with
    Salesperson AS(
    select distinct codeslsp1 'SP',
    case when pctsasplt1<>0 and codeslsp1 = '' then amtbaldueh else (pctsasplt1 * amtbaldueh/100) end 'OS'
    from arcus
    union
    select distinct codeslsp2 'SP',
    case when pctsasplt2<>0 and codeslsp2 = '' then amtbaldueh else (pctsasplt2 * amtbaldueh/100) end 'OS'
    from arcus
    union
    select distinct codeslsp3 'SP',
    case when pctsasplt3<>0 and codeslsp3 = '' then amtbaldueh else (pctsasplt3 * amtbaldueh/100) end 'OS'
    from arcus
    union
    select distinct codeslsp4 'SP',
    case when pctsasplt4<>0 and codeslsp4 = '' then amtbaldueh else (pctsasplt4 * amtbaldueh/100) end 'OS'
    from arcus
    union
    select distinct codeslsp5 'SP',
    case when pctsasplt5<>0 and codeslsp5 = '' then amtbaldueh else (pctsasplt5 * amtbaldueh/100) end 'OS'
    from arcus)
    select SP = (case when SP = '' then 'Others' else SP end), sum(OS) 'OS'
    from Salesperson
    group by SP
    ************************************************** *******

  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    A few questions:
    - What version of PSQL are you using?
    - What have you tried to convert it?
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

Posting Permissions

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