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 > Pervasive.SQL > Need Convertion to Pervasive SQL

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-07-09, 11:08
raabii raabii is offline
Registered User
 
Join Date: Jan 2009
Posts: 2
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
************************************************** *******
Reply With Quote
  #2 (permalink)  
Old 01-07-09, 11:13
mirtheil mirtheil is online now
Registered User
 
Join Date: Dec 2001
Posts: 1,015
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.
Reply With Quote
Reply

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On