跳至主要內容

需要打印的日记账分录

五六零网校小于 1 分钟

示例代码

DECLARE @BeginDate DATETIME ,
    @EndDate DATETIME ,
    @name NVARCHAR(40)
SET @BeginDate = /* FROM ojdt T0 WHERE T0.taxDate >= */ '[%0]'
SET @EndDate = /* FROM ojdt T1 WHERE T1.taxDate <= */ '[%1]'
SET @name = /* FROM ojdt T2 WHERE T2.Creator = */ '[%2]'
SELECT  t0.TransId ,
        t0.Number AS '凭单号' ,
        t0.TaxDate AS '凭单日期' ,
        t0.DocType AS '凭单类型' ,
        t0.Memo AS '摘要' ,
        t1.Debit AS '借方金额' ,
        t1.Credit AS '贷方金额' ,
        t0.Creator AS '创建者' ,
        t0.Printed AS '打印标记'
FROM    OJDT t0
        INNER JOIN JDT1 t1 ON t1.TransId = t0.TransId
WHERE   t0.Printed = 'N'
        AND ( t0.TaxDate >= @BeginDate
              OR ISNULL(@BeginDate, N'') = N''
            )
        AND ( t0.TaxDate <= @EndDate
              OR ISNULL(@EndDate, N'') = N''
            )
        AND ( t0.Creator LIKE '%' + @name + '%'
              OR ISNULL(@name, N'') = N''
            )
FOR     BROWSE