Esta es la consulta que la hicieron mediante un programa llamado StarQuery y la
usaban ahi, la necesito pasar a un gridview en asp.net C#
SELECT "XX10"."XX10_MNEPRCSTA", "OM01"."OM01_CPYCOD", "OM01"."OM01_DELLOC", "XX10"."XX10_DELDAT", "XX10"."XX10_BATDAT",
"XX10"."XX10_SUBPRCSTA1", SUBSTR("XX18"."XX18_MSGTXT", 1, 20), "OM01"."OM01_SALRTE", "OM01"."OM01_SALGRP", "AM01"."AM01_ARTGRP7",
SUBSTR("XI01_01"."XI01_DATAFIELD", 1, 20), CASE WHEN SUBSTR("OM01"."OM01_USRARE030G", 16, 1) = '1' THEN 'Desarrollador' ELSE 'Captador' END
FROM (((("BASXX90"."XX10" "XX10" LEFT OUTER JOIN ("BASXX90"."XX20" "XX20"
LEFT OUTER JOIN
"BASXX90"."AM01" "AM01" ON DIGITS("AM01"."AM01_ARTNUM") concat DIGITS("AM01"."AM01_EFTDAT") = DIGITS("XX20"."XX20_ARTNUM") concat '1999999')
ON "XX20"."XX20_TRANUM"="XX10"."XX10_TRANUM")
LEFT OUTER JOIN "BASXX90"."OM01" "OM01" ON "XX10"."XX10_OUTNUM"="OM01"."OM01_OUTNUM")
LEFT OUTER JOIN "BASXX90"."XI01" "XI01_01" ON 'XIC' concat 'GERMKT' concat SUBSTR("OM01"."OM01_USRARE030G", 9, 1) =
"XI01_01"."XI01_RECID" concat "XI01_01"."XI01_MAINKEY" concat SUBSTR("XI01_01"."XI01_SUBKEY", 3, 1))
LEFT OUTER JOIN "BASXX90"."XX18" "XX18" ON "XX10"."XX10_TRANUM" concat "XX10"."XX10_SUBPRCSTA1" concat 'R' =
"XX18"."XX18_TRANUM" concat "XX18"."XX18_MSGIDF")
WHERE ("AM01"."AM01_ARTGRP8" = '1') AND ("XX10"."XX10_MNEPRCSTA" = 'INF' OR "XX10"."XX10_MNEPRCSTA" = 'SMB' OR "XX10"."XX10_MNEPRCSTA" = 'SMF')
AND ("XX10"."XX10_DETCOD" = '111' OR "XX10"."XX10_DETCOD" = '112' OR "XX10"."XX10_DETCOD" = '113') AND ("XX10"."XX10_TRAOGNAPP" = 'OE'
OR "XX10"."XX10_TRAOGNAPP" = 'SM')
Esta es mi consulta que he hecho pero no me sale el mismo resultado algo me falta me parece.. por ejemplo no uso el DIGITS que se usa en la consulta de arriba por que no me lo acepta. Tambien uso un CONCAT dentro de otro no se si estara bien eso?
esta es
SELECT EMBONOR1.BASXX90.XX10.XX10_MNEPRCSTA AS ESTADO, EMBONOR1.BASXX90.OM01.OM01_CPYCOD AS PLANTA,
EMBONOR1.BASXX90.OM01.OM01_DELLOC AS SUCURSAL, EMBONOR1.BASXX90.XX10.XX10_DELDAT AS F_FACTU,
EMBONOR1.BASXX90.XX10.XX10_BATDAT AS F_LIQUI, EMBONOR1.BASXX90.XX10.XX10_SUBPRCSTA1 AS RETORNO,
CASE WHEN EMBONOR1.BASXX90.XX10.XX10_SUBPRCSTA1 = 'UNP' THEN SUBSTR(EMBONOR1.BASXX90.XX18.XX18_MSGTXT, 1, 20) END AS TxRetorno,
EMBONOR1.BASXX90.OM01.OM01_SALRTE AS ZnRt, EMBONOR1.BASXX90.OM01.OM01_SALGRP AS Territorio,
SUBSTR(EMBONOR1.BASXX90.XI01.XI01_DATAFIELD, 1, 20) AS Gerencia, CASE WHEN SUBSTR(EMBONOR1.BASXX90.OM01.OM01_USRARE030G, 16, 1)
= '1' THEN ('Desarrollador') ELSE ('Captador') END AS TipoCuenta, EMBONOR1.BASXX90.AM01.AM01_ARTGRP7 AS COD_FAM,
CASE WHEN EMBONOR1.BASXX90.XX10.XX10_SUBPRCSTA1 = 'UNP' THEN EMBONOR1.BASXX90.XX20.XX20_UNI * EMBONOR1.BASXX90.AM01.AM01_ARTCNVFAC1
* - 1 ELSE EMBONOR1.BASXX90.XX20.XX20_UNI * EMBONOR1.BASXX90.AM01.AM01_ARTCNVFAC1 END AS CAJAS_U, SUBSTR(EMBONOR1.BASXX90.FAMILIA.XI01_DATAFIELD, 1, 11) as familia
FROM ( (((( EMBONOR1.BASXX90.XX10
LEFT OUTER JOIN
EMBONOR1.BASXX90.OM01 ON EMBONOR1.BASXX90.XX10.XX10_OUTNUM = EMBONOR1.BASXX90.OM01.OM01_OUTNUM )
LEFT OUTER JOIN
(EMBONOR1.BASXX90.XX20 LEFT OUTER JOIN
EMBONOR1.BASXX90.AM01 ON CONCAT(EMBONOR1.BASXX90.AM01.AM01_ARTNUM,EMBONOR1. BASXX90.AM01.AM01_EFTDAT) = CONCAT(EMBONOR1.BASXX90.XX20.XX20_ARTNUM,'1999999' ) ) ON
EMBONOR1.BASXX90.XX20.XX20_TRANUM = EMBONOR1.BASXX90.XX10.XX10_TRANUM)
LEFT OUTER JOIN
EMBONOR1.BASXX90.XI01 ON
CONCAT('XIC',CONCAT('GERMKT',SUBSTR(EMBONOR1.BASXX 90.OM01.OM01_USRARE030G, 9, 1))) = CONCAT(EMBONOR1.BASXX90.XI01.XI01_RECID,CONCAT(EMB ONOR1.BASXX90.XI01.XI01_MAINKEY,SUBSTR(EMBONOR1.BA SXX90.XI01.XI01_SUBKEY, 3, 1))))
LEFT OUTER JOIN
EMBONOR1.BASXX90.XX18 ON CONCAT(EMBONOR1.BASXX90.XX10.XX10_TRANUM,CONCAT(EM BONOR1.BASXX90.XX10.XX10_SUBPRCSTA1,'R')) = CONCAT(EMBONOR1.BASXX90.XX18.XX18_TRANUM, EMBONOR1.BASXX90.XX18.XX18_MSGIDF))
LEFT OUTER JOIN
EMBONOR1.BASXX90.FAMILIA FAMILIA ON EMBONOR1.BASXX90.AM01.AM01_ARTGRP7 = SUBSTR(FAMILIA.XI01_SUBKEY, 3, 1))
WHERE (EMBONOR1.BASXX90.XX10.XX10_DELDAT BETWEEN ? AND ?) AND (EMBONOR1.BASXX90.OM01.CPYCOD = ?) AND
(EMBONOR1.BASXX90.AM01.AM01_ARTGRP8 = '1') AND (EMBONOR1.BASXX90.XX10.XX10_MNEPRCSTA = 'INF' OR
EMBONOR1.BASXX90.XX10.XX10_MNEPRCSTA = 'SMB' OR
EMBONOR1.BASXX90.XX10.XX10_MNEPRCSTA = 'SMF') AND (EMBONOR1.BASXX90.XX10.XX10_DETCOD = '111' OR
EMBONOR1.BASXX90.XX10.XX10_DETCOD = '112' OR
EMBONOR1.BASXX90.XX10.XX10_DETCOD = '113') AND (EMBONOR1.BASXX90.XX10.XX10_TRAOGNAPP = 'OE' OR
EMBONOR1.BASXX90.XX10.XX10_TRAOGNAPP = 'SM') and
EMBONOR1.BASXX90.XX20.XX20_EFTUPDSEQ = 999 and
EMBONOR1.BASXX90.XX20.XX20_ARTVRSRSO <> '59' AND EMBONOR1.BASXX90.XX20.XX20_ARTVRSRSO <> '29'