Arreglo Tilde Concursados- RHUN
1) Copiar dh03.dat desde el pampa rhun a un Pampa en c:\ (crear conexion Pervasive a ese pampa c)
2) Abrir una Pervasive, conexion a Pampa c via control center
3) loguearse como Master
SELECT count(*) FROM "DH03" where cargo_concursado=0 AND codc_carac='CONC'
update "DH03" set cargo_concursado=1 where cargo_concursado=0 AND codc_carac='CONC'
SELECT count(*) FROM "DH03" where cargo_concursado=1 AND codc_carac<>'CONC'
update "DH03" set cargo_concursado=0 where cargo_concursado=1 AND codc_carac<>'CONC'
select * from dh03 where codc_categ='320' update "DH03" set hs_dedic=TRUNCATE(hs_dedic*20/30,2) where codc_categ in ('318','320','321')
select distinct hs_dedic,hs_dedic*20/30 as hs_reloj,left(CONVERT(hs_dedic*20/30, SQL_CHAR),locate(',',CONVERT(hs_dedic*20/30, SQL_CHAR)))+SUBSTRING (CONVERT(hs_dedic*20/30, SQL_CHAR), locate(',',CONVERT(hs_dedic*20/30, SQL_CHAR))+1, 2) from dh03 where codc_categ in ('318','320','321') IF (predicate, expression1, expression2)
select distinct hs_dedic,IF((hs_dedic/(left(CONVERT(hs_dedic*20/30, SQL_CHAR),locate(',',CONVERT(hs_dedic*20/30, SQL_CHAR)))))>0, left(CONVERT(hs_dedic*20/30, SQL_CHAR),locate(',',CONVERT(hs_dedic*20/30, SQL_CHAR)))+SUBSTRING (CONVERT(hs_dedic*20/30, SQL_CHAR), locate(',',CONVERT(hs_dedic*20/30, SQL_CHAR))+1, 2) from dh03 where codc_categ in ('318','320','321')
update dh03 set hs_dedic=hs_dedic*20/30 where codc_categ in ('318','320','321')
select hs_dedic,hs_dedic*20/30 as hs_reloj,convert((hs_dedic*20/30),SQL_INTEGER) as parte_entera,
4) renombrar el dh03.dat que esta en Pampa Rhun, poner dh03.original
5) una vez ejecutadas los updates pasar el DH03.DAT a el pampa rhun que se esta procesando