consulta1.sql
DECLARE @INI VARCHAR(10)=‘2019-08-01’, @FIN VARCHAR(10)=‘2019-08-31’,@CTA VARCHAR(30)=‘2150.0011.0001.0004’,@Subtotal NUMERIC(19,4),@Iva NUMERIC(19,4),@Total NUMERIC(19,4),@CDML NUMERIC(19,4),@Divi NUMERIC(19,4)
CREATE TABLE #General
(No int IDENTITY(1,1),Fecha DATE,TransId int,BaseRef int,
ContraAct varchar(50),LineMemo varchar(80),Segment_0 varchar(80),ML numeric(12,2),
CardCode VARCHAR(20),RFC varchar(20),Name VARCHAR(80),Divi numeric(19,2),CardCode2 VARCHAR(20),RFC2 varchar(20),Name2 VARCHAR(80))
INSERT INTO #General
SELECT T0.RefDate,T0.TransId,T0.BaseRef,T0.ContraAct,T0.LineMemo,T1.Segment_0,CAST((T0.Debit+(- T0.Credit)) AS NUMERIC(11,2)) AS ‘C/D (ML)’,
(SELECT TX.ShortName
FROM JDT1 TX
FULL OUTER JOIN OACT T1 ON T1.AcctCode=TX.Account
This file has been truncated. show original
consulta2.sql
CREATE TABLE #General2
(No int IDENTITY(1,1),Fecha DATE,TransId int,BaseRef int,
ContraAct varchar(50),LineMemo varchar(80),Segment_0 varchar(80),ML numeric(12,2),
CardCode VARCHAR(20),RFC varchar(20),Name VARCHAR(80),Divi numeric(19,2),CardCode2 VARCHAR(20),RFC2 varchar(20),Name2 VARCHAR(80))
INSERT INTO #General2
SELECT T0.RefDate,T0.TransId,T0.BaseRef,T0.ContraAct,T0.LineMemo,T1.Segment_0,CAST((T0.Debit+(- T0.Credit)) AS NUMERIC(11,2)) AS ‘C/D (ML)’,
(SELECT TX.ShortName
FROM JDT1 TX
FULL OUTER JOIN OACT T1 ON T1.AcctCode=TX.Account
This file has been truncated. show original