Detailed aged debtors query

Hi All
I am trying to create a detailed aged debtors report for all unreconciled transactions.  I have started the query but it does not seem to want to work correctly.  It returns all transactions, regardless if reconciles or not.
Any help will be appreciated.
SELECT T1.CardCode, T1.CardName, T0.MthDate, T1.CreditLine, T0.RefDate, T0.Ref1 'Document No.',
            CASE  WHEN T0.TransType=13 THEN 'Invoice'
                        WHEN T0.TransType=14 THEN 'Credit Note'
                        WHEN T0.TransType=30 THEN 'Journal'
                        WHEN T0.TransType=24 THEN 'Receipt' end as 'Document Type',
T0.DueDate, (T0.Debit- T0.Credit)'Balance'
            ,ISNULL((SELECT T0.Debit- T0.Credit WHERE DateDiff(day, T0.refDate,'[%1]')<=-1),0) 'Future'
            ,ISNULL((SELECT T0.Debit- T0.Credit WHERE DateDiff(day, T0.refDate,'[%1]')>=0 and DateDiff(day, T0.refDate,'[%1]')<=30),0) 'Current'
            ,ISNULL((SELECT T0.Debit- T0.Credit WHERE DateDiff(day, T0.refDate,'[%1]')>=31 and DateDiff(day, T0.refDate,'[%1]')<=60),0)'31-60 Days'
            ,ISNULL((SELECT T0.Debit- T0.Credit WHERE DateDiff(day, T0.refDate,'[%1]')>=61 and DateDiff(day, T0.refDate,'[%1]')<=90),0)'61-90 Days'
            ,ISNULL((SELECT T0.Debit- T0.Credit WHERE DateDiff(day, T0.refDate,'[%1]')>=91 and DateDiff(day, T0.refDate,'[%1]')<=120),0) '91-120 Days'  ,ISNULL((SELECT T0.Debit- T0.Credit WHERE DateDiff(day, T0.refDate,'[%1]')>=121),0) '121+ Days'
FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
WHERE (T0.MthDate <= '[%1]' or t0.mthdate IS NULL) AND t0.refdate <= '[%1]' and T1.CardType = 'C'
ORDER BY T1.CardCode, T0.DueDate, T0.Ref1

Thank you Gordon and Julie.
I have changed the sys deb/cred to balduedeb/cred and it works prefectly.
Would it be possible to run the query retrospectivly? i want to be able to produce monthly debtors at any given time ie Febs balance but run in March.?
Thanks in advance.

Similar Messages

  • Error In Aged Debtors Query

    Hi there
    I've tring to produce an aged debtor query and am getting the following error am producing this report in qlikview
    SQL error: The multi-part identifier "T0.ShortName" could not be bound
    Please could some one look at my query and tell me where am going wrong i beleve it's something to do with my inner join but am not sure as am fairly new to this
    Any help would be most appreciated as am at a total dead end on this one
    <p></p>
    SELECT <br>
    T0.ShortName 'Account Code',<br>
    T0.intrnmatch 'Internal Reconciliation No',<br>
    T0.BALDUEDEB, <br>
    T0.BALDUECRED,<br>
    T0.sysdeb 'System Debit Amount',<br>
    T0.syscred 'System Credit Amount',<br>
    (T0.sysdeb - T0.syscred) AS 'System Balance Due', <br>
    T0.debit 'Local Debit Amount',<br>
    T0.credit 'Local Credit Amount',<br>
    (T0.debit - T0.credit) AS 'Local Balance Due',<br>
    T0.fcdebit 'FC Debit Amount',<br>
    T0.fccredit 'FC Credit Amount',<br>
    (T0.fcdebit - T0.fccredit) AS 'FC Balance Due',<br>
    case T0.fccurrency<br>
         when 'EUR' then T0.fcdebit - T0.fccredit<br>
         when 'USD' then T0.sysdeb - T0.syscred<br>
         else T0.debit - T0.credit<br>
    end 'Balance Due',<br>
    case T0.transtype<br>
         when '13' then 'INV'<br>
         when '14' then 'AR CN'<br>
         when '24' then 'INCOMING'<br>
         else 'Other'<br>
    end 'Type',<br>
    T0.Ref1,<br>
    T0.fccurrency 'BP Currency',<br>
    CONVERT(VARCHAR(10), T0.refdate, 103) 'Posting Date',<br>
    CONVERT(VARCHAR(10), T0.duedate, 103) 'Due Date',<br>
    CONVERT(VARCHAR(10), T0.taxdate, 103) 'Doc Date' ,<br>
    T1.WhsCode 'Warehouse',<br>
    T2.cardcode 'Bp Code',<br>
    T2.cardname 'Name',<br>
    T2.SlpCode 'Slp Code',<br>
    T2.GroupCode 'Group Code',<br>
    T2.CreditLine 'Credit Limit',<br>
    T2.DebtLine 'Debt Limit',<br>
    T3.GroupName 'Customer Name',<br>
    T3.GroupType 'Group Type',<br>
    T4.ItmsGrpCod 'Item Group Code',<br>
    T5.ItmsGrpNam 'Item Group Name',<br>
    T6.SlpName 'Sales Employee',<br>
    //Calculate 0-30 Days
    CASE
    when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 < 31
              then
              case
                   when T0.syscred <> 0 then -T0.syscred
                        else T0.sysdeb
              end
    end "System 0-30 days",
    CASE
    when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 < 31          then
              case
                   when T0.credit <> 0 then -T0.credit
                        else T0.debit
              end
    end "LC 0-30 days",
    CASE
    when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 < 31
              then
              case
                   when T0.fccredit <> 0 then -T0.fccredit
                        else T0.fcdebit
              end
    end "FC 0-30 days",
    // Calculate 31-60 Days
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 30
    and (datediff(dd,T0.refdate,current_timestamp))+1< 61)
              then
              case
                   when T0.syscred <> 0 then -T0.syscred
                        else T0.sysdeb
              end
    end "System 31-60 days",
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 30
    and (datediff(dd,T0.refdate,current_timestamp))+1< 61)
              then
              case
                   when T0.credit <> 0 then -T0.credit
                        else T0.debit
              end
    end "LC 31-60 days",
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 30
    and (datediff(dd,T0.refdate,current_timestamp))+1< 61)
              then
              case
                   when T0.fccredit <> 0 then -T0.fccredit
                        else T0.fcdebit
              end
    end "FC 31-60 days",
    // Calculate 61-90 Days
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 60
    and (datediff(dd,T0.refdate,current_timestamp))+1< 91)
              then
              case
                   when T0.syscred <> 0 then -T0.syscred
                        else T0.sysdeb
              end
    end "System 61-90 days",
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 60
    and (datediff(dd,T0.refdate,current_timestamp))+1< 91)
              then
              case
                   when T0.credit <> 0 then -T0.credit
                        else T0.debit
              end
    end "LC 61-90 days",
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 60
    and (datediff(dd,T0.refdate,current_timestamp))+1< 91)
              then
              case
                   when T0.fccredit <> 0 then -T0.fccredit
                        else T0.fcdebit
              end
    end "FC 61-90 days",
    // Calculate 91-120 Days
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 90
    and (datediff(dd,T0.refdate,current_timestamp))+1< 121)
              then
              case
                   when T0.syscred <> 0 then -T0.syscred
                        else T0.sysdeb
              end
    end "System 91-120 days",
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 90
    and (datediff(dd,T0.refdate,current_timestamp))+1< 121)
              then
              case
                   when T0.credit <> 0 then -T0.credit
                        else T0.debit
              end
    end "LC 91-120 days",
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 90
    and (datediff(dd,T0.refdate,current_timestamp))+1< 121)
              then
              case
                   when T0.fccredit <> 0 then -T0.fccredit
                        else T0.fcdebit
              end
    end "FC 91-120 days",
    // Calculate 120+ Days
    CASE when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 > 120
              then
              case
                   when T0.syscred= 0 then T0.sysdeb
                   when T0.sysdeb= 0 then -T0.syscred
              end
    end "System 120+ days",
    CASE when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 > 120
              then
              case
                   when T0.credit= 0 then T0.debit
                   when T0.debit= 0 then -T0.credit
              end
    end "LC 120+ days",
    CASE when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 > 120
              then
              case
                   when T0.fccredit= 0 then T0.fcdebit
                   when T0.fcdebit= 0 then -T0.fccredit
              end
    end "FC 120+ days"<br>
    FROM JDT1 T0, INV1 T1<br>
    INNER JOIN OCRD T2 ON T1.BaseCard = T2.CardCode AND T0.ShortName = T2.CardCode AND T2.CardType = 'C' <br>
    INNER JOIN OCRG T3 ON T2.GroupCode = T3.GroupCode <br>
    INNER JOIN OITM T4 ON T1.ItemCode = T4.ItemCode <br>
    INNER JOIN OITB T5 ON T4.ItmsGrpCod = T5.ItmsGrpCod <br>
    INNER JOIN OSLP T6 ON T1.SlpCode = T6.SlpCode <br>
    WHERE T0.intrnmatch = '0' AND T0.BALDUEDEB != T0.BALDUECRED <br>
    ORDER BY T2.CardCode;<br>
    Edited by: Mcphee78 on Oct 15, 2010 2:38 PM

    HI,
    Try below query:
    SELECT
    T0.ShortName 'Account Code',
    T0.intrnmatch 'Internal Reconciliation No',
    T0.BALDUEDEB,
    T0.BALDUECRED,
    T0.sysdeb 'System Debit Amount',
    T0.syscred 'System Credit Amount',
    (T0.sysdeb - T0.syscred) AS 'System Balance Due',
    T0.debit 'Local Debit Amount',
    T0.credit 'Local Credit Amount',
    (T0.debit - T0.credit) AS 'Local Balance Due',
    T0.fcdebit 'FC Debit Amount',
    T0.fccredit 'FC Credit Amount',
    (T0.fcdebit - T0.fccredit) AS 'FC Balance Due',
    case T0.fccurrency
    when 'EUR' then T0.fcdebit - T0.fccredit
    when 'USD' then T0.sysdeb - T0.syscred
    else T0.debit - T0.credit
    end 'Balance Due',
    case T0.transtype
    when '13' then 'INV'
    when '14' then 'AR CN'
    when '24' then 'INCOMING'
    else 'Other'
    end 'Type',
    T0.Ref1,
    T0.fccurrency 'BP Currency',
    CONVERT(VARCHAR(10), T0.refdate, 103) 'Posting Date',
    CONVERT(VARCHAR(10), T0.duedate, 103) 'Due Date',
    CONVERT(VARCHAR(10), T0.taxdate, 103) 'Doc Date' ,
    T1.WhsCode 'Warehouse',
    T2.cardcode 'Bp Code',
    T2.cardname 'Name',
    T2.SlpCode 'Slp Code',
    T2.GroupCode 'Group Code',
    T2.CreditLine 'Credit Limit',
    T2.DebtLine 'Debt Limit',
    T3.GroupName 'Customer Name',
    T3.GroupType 'Group Type',
    T4.ItmsGrpCod 'Item Group Code',
    T5.ItmsGrpNam 'Item Group Name',
    T6.SlpName 'Sales Employee',
    --Calculate 0-30 Days
    CASE when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 < 31 then case when T0.syscred <> 0 then -T0.syscred else T0.sysdeb end end "System 0-30 days", CASE when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 < 31 then case when T0.credit <> 0 then -T0.credit else T0.debit end end "LC 0-30 days", CASE when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 < 31 then case when T0.fccredit <> 0 then -T0.fccredit else T0.fcdebit end end "FC 0-30 days",
    -- Calculate 31-60 Days
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 30 and (datediff(dd,T0.refdate,current_timestamp))+1< 61) then case when T0.syscred <> 0 then -T0.syscred else T0.sysdeb end end "System 31-60 days", case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 30 and (datediff(dd,T0.refdate,current_timestamp))+1< 61) then case when T0.credit <> 0 then -T0.credit else T0.debit end end "LC 31-60 days", case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 30 and (datediff(dd,T0.refdate,current_timestamp))+1< 61) then case when T0.fccredit <> 0 then -T0.fccredit else T0.fcdebit end end "FC 31-60 days",
    --Calculate 61-90 Days
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 60 and (datediff(dd,T0.refdate,current_timestamp))+1< 91) then case when T0.syscred <> 0 then -T0.syscred else T0.sysdeb end end "System 61-90 days", case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 60 and (datediff(dd,T0.refdate,current_timestamp))+1< 91) then case when T0.credit <> 0 then -T0.credit else T0.debit end end "LC 61-90 days", case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 60 and (datediff(dd,T0.refdate,current_timestamp))+1< 91) then case when T0.fccredit <> 0 then -T0.fccredit else T0.fcdebit end end "FC 61-90 days",
    -- Calculate 91-120 Days
    case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 90 and (datediff(dd,T0.refdate,current_timestamp))+1< 121) then case when T0.syscred <> 0 then -T0.syscred else T0.sysdeb end end "System 91-120 days", case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 90 and (datediff(dd,T0.refdate,current_timestamp))+1< 121) then case when T0.credit <> 0 then -T0.credit else T0.debit end end "LC 91-120 days", case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 90 and (datediff(dd,T0.refdate,current_timestamp))+1< 121) then case when T0.fccredit <> 0 then -T0.fccredit else T0.fcdebit end end "FC 91-120 days",
    -- Calculate 120+ Days
      CASE when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 > 120 then case when T0.syscred= 0 then T0.sysdeb when T0.sysdeb= 0 then -T0.syscred end end "System 120+ days", CASE when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 > 120 then case when T0.credit= 0 then T0.debit when T0.debit= 0 then -T0.credit end end "LC 120+ days", CASE when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 > 120 then case when T0.fccredit= 0 then T0.fcdebit when T0.fcdebit= 0 then -T0.fccredit end end "FC 120+ days"
    FROM JDT1 T0, INV1 T1
    INNER JOIN OCRD T2 ON T1.BaseCard = T2.CardCode AND T2.CardType = 'C'
    INNER JOIN OCRG T3 ON T2.GroupCode = T3.GroupCode
    INNER JOIN OITM T4 ON T1.ItemCode = T4.ItemCode
    INNER JOIN OITB T5 ON T4.ItmsGrpCod = T5.ItmsGrpCod
    INNER JOIN OSLP T6 ON T1.SlpCode = T6.SlpCode
    WHERE T0.intrnmatch = '0' AND T0.BALDUEDEB != T0.BALDUECRED and (T0.ShortName=T2.CardCode )
    ORDER BY T2.CardCode
    Thanks,
    Neetu

  • Detailed Aged Customer Report

    Hi Experts,
    I would like to report in excel the same information which shows in the print preview of the Detailed Aged Debtors report...is there a way to do this at all please?
    Many thanks
    Caroline

    Hi Caroline,
    You may create a query report to match Detailed Aged Customer Report first.  If this has been done, you may include this query to Excel directly by New Database query.
    Thanks,
    Gordon

  • Setting system variable in the Detailed Aging PLD report

    Does anyone know which variable I can use to get the FC value displayed on the Aged Debtors PLD detailed form?
    The current aging layout (in SBO) either shows it all in LC or in the currency you choose, but if you have a Business Partner who trades in different currencies and you have invoices raised in those different currencies you cannot see the value for each currency seperately, which is causing some distress.
    I was hoping that by some miraculous twist of fate I can include the FC value in the PLD report thereby saving the hassle of having to re-write the report. (I have checked the System Variable Excel spreadsheet but cannot find it in there.)
    Many thanks
    Hayden

    Hi Julie
    I wondered if you are able to help me get the foreign currency Code and Value into this query you did from a previous post.
    I'm getting odd results and I cant work out where I'm going wrong
    Many thanks
    Hayden
    /* SELECT FROM OINV T0 / declare @AgingDate DateTime / WHERE */ SELECT @AgingDate = GetDate()
    /* SELECT FROM OCRD T1 / declare @CustomerFrom nvarchar(20) / WHERE */ set @CustomerFrom  = ''
    /* SELECT FROM OCRD T2 / declare @CustomerTo nvarchar(20) / WHERE */ set @CustomerTo = ''
    /* SELECT FROM OCRD T3 / declare @OnHold nvarchar(20) / WHERE */ set @OnHold = 'N'
    /* SELECT FROM OSLP T4 / declare @SalesRep nvarchar(30) / WHERE */ set @SalesRep = ''
    IF @AgingDate = CONVERT(datetime, '', 112) set @AgingDate = GetDate()
    select
         JD.FCCurrency [Foreign Currency],
         ocrd.CardCode [BP Code],
         ocrd.CardName [BP Name],
         ocrd.FrozenFor [On Hold],
         @AgingDate [Aging Date],
         isnull(T7.[BalanceDue],0) [Balance],
         isnull(T7.[Current],0) [Current],
         isnull(T7.[30Days],0) [1 Month],
         isnull(T7.[60Days],0) [2 Months],
         isnull(T7.[90Days],0) [3+ Months],
         ocrd.CreateDate,
         T8.[Last Payment Date],
              (SELECT
                   SUM(T1.DocTotal)
              FROM ORCT T1
              WHERE T1.CardCode = T8.CardCode AND
                        T1.DocDate = T8.[Last Payment Date]) [Total Last Payment],
         oslp.SlpName [Sales Rep],
         ocrd.CntctPrsn [Key Contact],
         ISNULL(ocpr.Tel1, ISNULL(ocpr.Cellolar, ocrd.Phone1)) [Contact Phone]
    from ocrd left outer join
         ocpr on ocpr.Name = ocrd.CntctPrsn and
         ocpr.CardCode = ocrd.CardCode left outer join
         oslp on oslp.SlpCode = ocrd.SlpCode left outer join
              SELECT
                   T0.CardCode,
                   SUM(T1.Original-T1.Cleared) [BalanceDue],
                   SUM(CASE
                             WHEN T1.AgeDays < 0 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [Current],
                   SUM(CASE
                             WHEN T1.AgeDays BETWEEN 0 AND 30 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [30Days],
                   SUM(CASE
                             WHEN T1.AgeDays BETWEEN 31 AND 60 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [60Days],
                   SUM(CASE
                             WHEN T1.AgeDays > 60 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [90Days],
                   SUM(CASE
                             WHEN T1.AgeDays > 30 THEN T1.Original+T1.Cleared
                             ELSE 0
                        END) [Overdue]
              FROM ocrd T0 LEFT OUTER JOIN
                   (SELECT
                        T1.CardCode,
                        T0.TransId,
                        T0.Line_ID,
                        DateDiff(m, T0.DueDate, @AgingDate) [AgeMonths],
                        DateDiff(d, T0.DueDate, @AgingDate) [AgeDays],
                        --Get standar Debit/Credit Col OR FCCredit/FCDebit columns for
                        --caluculations in outer query
                        ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Debit Else T0.FCDebit END )
                        ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Credit Else T0.FCCredit END ) [Original],
                        --T0.Debit-T0.Credit [Original],
                        SUM(ISNULL(T2.ReconSum,0)*     CASE T2.IsCredit WHEN N'C' THEN 1 ELSE -1 END) [Cleared],
                             ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Debit Else T0.FCDebit END )
                             ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Credit Else T0.FCCredit END )
                        + SUM(ISNULL(T2.ReconSum,0)* CASE T2.IsCredit WHEN N'C' THEN 1 ELSE -1 END) [Balance]
                        --(T0.Debit-T0.Credit) + SUM(ISNULL(T2.ReconSum,0)* CASE T2.IsCredit WHEN N'C' THEN 1 ELSE -1 END) [Balance]
                   FROM jdt1 T0 inner join
                        ocrd T1 on T1.CardCode = T0.ShortName left outer join
                        itr1 T2 on T2.TransId = T0.TransId and
                        T2.TransRowId = T0.Line_ID and
                        T2.ReconNum = (     select
                                                 T3.ReconNum
                                            from oitr T3
                                            where     T3.ReconNum = T2.ReconNum and
                                                      T3.Canceled = N'N' and
                                                      T3.ReconType = 7 and
                                                      T3.ReconDate <= @AgingDate)
                   WHERE     T0.RefDate <= @AgingDate and
                             T1.CardType = 'C' and
                             (T1.CardCode >= @CustomerFrom OR @CustomerFrom = '') and
                             (T1.CardCode <= @CustomerTo OR @CustomerTo = '')
                   GROUP BY T1.CardCode, T0.TransId, T0.Line_ID, T0.DueDate, T0.Debit, T0.FCDebit, T0.Credit, T0.FCCredit, T0.FCCurrency
    --                    ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Debit Else T0.FCDebit END )
    --                    ( CASE WHEN T0.FCCurrency IS NULL THEN T0.Credit Else T0.FCCredit END ), T0.FCCurrency
                        --T0.Debit-T0.Credit
                   ) T1 on T1.CardCode = T0.CardCode
              WHERE T0.CardType = N'C'
              GROUP BY T0.CardCode ) T7 on T7.CardCode = ocrd.CardCode left outer join
                   (SELECT
                        T1.CardCode,
                        Max(T1.DocDate) [Last Payment Date]
                   FROM ORCT T1
                   WHERE     (T1.CardCode >= @CustomerFrom OR @CustomerFrom = '') and
                             (T1.CardCode <= @CustomerTo OR @CustomerTo = '')
                   GROUP BY T1.CardCode ) T8 on T8.CardCode = ocrd.CardCode
    --put this join to get the
    --currency symbol from Journal Row table
    Left Outer join JDT1 JD On OCRD.CardCode = JD.ShortName
    where ocrd.CardType = 'C' and
         --(oslp.SlpName = @SalesRep OR @SalesRep = '') and
         (ocrd.CardCode >= @CustomerFrom OR @CustomerFrom = '') and
         (ocrd.CardCode <= @CustomerTo OR @CustomerTo = '') and
         (ocrd.ValidFor <>'Y') and
         ( (ocrd.FrozenFor = @OnHold and (GetDate() Between isnull(ocrd.FrozenFrom, DateAdd(d,-1,GetDate())) and isnull(ocrd.FrozenTo, DateAdd(d,1,GetDate())))))
    order by ocrd.CardCode

  • Due date in Detail Aging report

    Dear all,
    I would like to ask if it is possible to add the Due date for each document displayed in the Detailed Customer Receivable Againg report ?
    I tried, but it seems impossible to do so, even I set the field as System Variable (as the Due date in Dunning module).
    Thanks a lot

    Hi,
    'Due Date' column of the documents is available in:
    Aging Report - 'Customer Statement Report (One Page per Customer)'
    The same is unavailable in the Details Aging Report.
    Regards,
    Jitin

  • Customer Aging Report Query (without invoices offset by incoming payment)

    Hi All Experts,
    May I know is there any field from JDT1 mention which invoices is already offset by the Incoming payment or AR Credit note? Because I do not want those invoices that already offset by incoming payment appear at the Customer Aging Report. Meaning, the data appear in the Customer Aging Report is only show those invoices that yet to pay by the customer. Kindly give some advise on it. Thanks a lot.
    Thanks and regards,
    Angie Ng

    Hi David,
    Thanks for your suggestion. I have try it, but all of my JDT1.IntrnMatch is in 0 value. Meaning in my situation it is none of any reconcilliation making. But from my SBO window, i manage to see that actually this incoming payment is pay for which invoices. Problem is it is difficult for me to do the possiblity logic that might be happen in my Customer Aging Report Query. Please give some advise that how to show only those invoices yet to pay? The current query will show all the data no matter the invoices or credit memo has been offset.
    select OCRD.cardcode 'Supplier Code',OCRD.cardname 'Name',sysdeb  'Debit GBP',syscred 'Credit GBP',
    case JDT1.transtype
    when '13' then 'INV'
    when '14' then 'AR CN'
    when '24' then 'INCOMING'
    else 'Other'
    end 'Type',
    Ref1,
    fccurrency 'BP Currency',
    CONVERT(VARCHAR(10), refdate, 103)'Posting Date' ,
    CONVERT(VARCHAR(10), duedate, 103) 'Due Date',
    CONVERT(VARCHAR(10), taxdate, 103) 'Doc Date' ,
    CASE
    when (DATEDIFF(dd,refdate,current_timestamp))+1 < 31
    then
    case
    when syscred <> 0 then syscred * - 1
    else sysdeb
    end
    end "0-30 days",
    case when ((datediff(dd,refdate,current_timestamp))+1 > 30
    and (datediff(dd,refdate,current_timestamp))+1< 61)
    then
    case
    when syscred <> 0 then syscred * - 1
    else sysdeb
    end
    end "31 to 60 days",
    case when ((datediff(dd,refdate,current_timestamp))+1 > 60
    and (datediff(dd,refdate,current_timestamp))+1< 91)
    then
    case
    when syscred <> 0 then syscred * - 1
    else sysdeb
    end
    end "61 to 90 days",
    CASE
    when (DATEDIFF(dd,refdate,current_timestamp))+1 > 90
    then
    case
    when syscred= 0 then sysdeb
    when sysdeb= 0 then syscred * - 1
    end
    end "90 + days"
    from JDT1,OCRD where JDT1.shortname = OCRD.cardcode and cardtype = 'c' and intrnmatch = '0'
    ORDER BY OCRD.CARDCODE, taxdate

  • Crystal Reports 2008 Customer Details Aging Report Example / Sample

    Hello!
    Anyone willing to send me a customer details aging report example for SAP Business One? (or give me a link?)
    I've been looking all over and have found examples of things, but not specifically for B1.
    Anything would be useful I am pretty flexible, I just want some bones to work from.  In return I can send you back what I build from it.
    Thanks in advance,
    Mike

    Hi Mike, you might have better  replies if you post your question to the B1 forum. They would be familiar with the B1 functioanlity and data sources.

  • R12 AR Aging SQL Query....

    Hello all,
    I am new to apps technical..
    Please send me, the AR aging SQL query for 12.1.3.
    Thanks in Advence,
    Regards,
    Muthu

    Hi;
    Similar issue mention here many times, Please see:
    https://forums.oracle.com/forums/search.jspa?threadID=&q=AR+Aging&objID=c3&dateRange=all&userID=&numResults=15
    Regard
    Helios

  • Accounts Receivable:  Detail Aged Trial Balance

    Good Morning-
    Is there a detailed aged trial balance available in SAP or does it have to be customized.  I have reviewed all the available reports and none of them look like an aged trial balance.
    Please help.

    Your abaper maybe able to help you. We had one created by our abaper called 'Open Item Aged Receivable Summary'.
    Elias

  • How to hide repeated details using SQL Query?

    How to hide repeated details using SQL Query?
    For Ex:
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    10 | BLAKE | CLERK |
    10 | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    20 | ADAMS | CLERK |
    20 | KING | SALESMAN|
    ------------------------+
    How we can display the above details in the following way?
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    | BLAKE | CLERK |
    | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    | ADAMS | CLERK |
    | KING | SALESMAN|
    ------------------------+
    Thanks Advance

    Hi,
    you can use BREAK ON DEPTNO in SQL*Plus or use LAG.
    SQL> ed
    Wrote file afiedt.buf
      1  select nullif(department_id
      2                , lag(department_id) over (partition by department_id order by last_name)
      3         ) dept_id
      4  , last_name, job_id
      5*  from employees where department_id in (30,50) and rownum <=10
    SQL> /
       DEPT_ID LAST_NAME                 JOB_ID
            30 Baida                     PU_CLERK
               Colmenares                PU_CLERK
               Himuro                    PU_CLERK
               Khoo                      PU_CLERK
               Raphaely                  PU_MAN
               Tobias                    PU_CLERK
            50 Fripp                     ST_MAN
               Kaufling                  ST_MAN
               Vollman                   ST_MAN
               Weiss                     ST_MAN
    10 rows selected.

  • Aged Debtor List Sorting

    Hi,
    In versions of B1 upto 8.8 it was always possible to change the sort order on the Aged Debtors and Creditors List reports by double clicking on any of the ageing columns.  This was a very useful feature in credit control as it highlighted the oldest and highest debts on the screen and allowed these customers to be chased first. 
    In 8.8 the abililty to sort these reports has been removed, am I overlooking something or will the only way to get this feature back be to create a report layout.
    Thanks & kind regards.
    Edited by: Pamela May on Jul 12, 2010 1:05 PM

    Sorry did not put any code with it!!!
    try
    DataInputStream inputFile = new DataInputStream(new FileInputStream("Clients.txt"));
    String file;
    listArea.removeAll();
    listArea2.removeAll();
    listArea3.removeAll();
    listArea4.removeAll();
    //listArea5.removeAll();
    listArea6.removeAll();
    listArea7.removeAll();
    file = inputFile.readLine();
    while (file != null)
    StringTokenizer st = new StringTokenizer(file);
    listArea.add(st.nextToken());
    listArea2.add(st.nextToken());
    listArea3.add(st.nextToken());
    listArea4.add(st.nextToken());
    listArea5.add(st.nextToken());
    listArea5.removeAll();
    listArea6.add(st.nextToken());
    listArea7.add(st.nextToken("_"));
    file = inputFile.readLine();
    That is the piece that gets the data from the text file and assigns it to the lists. Now that i have the data in there respective list i need to sort each coloumn.
    Ive tried Collections.sort, Arrays.sort, bubblesort.
    This is part of a assignment that iam currently working on for university, and as part of the remit i cannot use Swing, which i know would make life a whole lot easier, so ive spent the whole of today (it is now 17:25 in England and i started at 10:30), trying in vain to get this to work, please can some one help!!!

  • Detailed Aging Report

    Hi
    Does anybody no the system variable to include the Customer/Supplier Ref No. in the Detailed Aging report.
    Thanks
    Jenny

    Jenny,
    The system variable number is 152.
    I don't know the reason for this question?
    But, if you are not seeing the BP Ref No on the Detailed Aging Report, it is probably because you are running the report using By Journal Postings Tab
    The BP Ref No will be visible if you run your Aging Report from By Sales Documents tab in the Customer Receivable Aging - Selection Criteria screen
    Suda

  • How to calculate aging iin query desiner in bi7.0

    Hi all,
    can any help me how to write a formula in bex  QUERY desiner bi7.0
    acullay i have service order creation date in my cube ERDAT and
    business requirements is calculate the aging
    i want to minus the current date with creation date and i need the result in DAYS
    i am new to BI .
    Regards,
    Raja

    Why ask same question again ????
    How to write a formula in BEX in bi7.0
    Create a formula variable of replacement path on service order creation date say ZSCRE
    Create a customer exit variable and populate sy-datum into it in the user exit of CMOD say ZSYDAT
    or
    There is one standard variable available as key date in BEX you can use that too.
    Create a formula or CKF  :
    Age days = ZSYDAT - ZSCRE.
    Hope this helps.
    Edited by: Praveen G on Sep 15, 2008 5:14 AM

  • Detailed Aging Report from SAP B1 v2007A

    Hello all,
    I have SAP Business One v 2007 A in my company. The auditors are coming in next week and I was trying to get the Aging report for both vendor and customer. The default summary looks good. To get the details, I have to go into each customer/vendor and collect them. Is there a way to get all the details in one shot (like an executing an SQL)?
    Thank you all so much.
    Manoj.

    Hello Manoj - maybe try this since it uses the actual General Journal entries found in the JDT1 table.  PS - I have no idea why it does not show the NOT EQUAL characters of < and > in the last CASE.  The CASE calculation should be the same in all instances - make sure you add that before running. I used the appropriate coding for the SQL - something about SAP forums!!!
    For Vendors, just change the CardType to S in the WHERE clause, the Transtype, and change the column headings to what you want them to say.
    Hope this helps...
    Regards - Zal
    --F-BP AR Aging Report Detail Ver 1 ZP 2011 04 16
    --DESCRIPTION:  SQL uses General Ledger Detail to create an Aging Report which shows
    actual invoices, credit memos, and payments by reference date in the JDT1 table.
    --AUTHOR(s):
    --Version 1 Zal Parchem 16 April 2011
    SELECT
    T1.CardCode AS 'Cust Num',
    T1.CardName AS 'Cust Name',
    T0.SysDeb AS 'Debit Amt',
    T0.SysCred * -1 AS 'Credit Amt',
    CASE
    WHEN T0.TransType = 13 THEN 'AR Invoice'
    WHEN T0.TransType = 14 THEN 'AR Cred Memo'
    WHEN T0.TransType = 24 THEN 'Payment'
    ELSE 'Other'
    END AS 'Trans Type',
    T0.Ref1 AS 'Reference',
    FcCurrency AS 'Currency',
    CONVERT(VARCHAR(10), RefDate, 103) 'Posting Date',
    CONVERT(VARCHAR(10), DueDate, 103) 'Due Date',
    CONVERT(VARCHAR(10), TaxDate, 103) 'Doc Date' ,
    CASE
    WHEN (DATEDIFF(DD,RefDate,Current_Timestamp)) +1 <  31 THEN
    CASE
    WHEN SysCred < > 0 THEN SysCred * -1
    ELSE SysDeb
    END
    END AS '0-30 Days',
    CASE
    WHEN (DATEDIFF(DD,RefDate,Current_Timestamp)) +1 > 30
    AND (DATEDIFF(DD,RefDate,Current_Timestamp)) +1 < 61 THEN
    CASE
    WHEN SysCred < > 0 THEN SysCred * -1
    ELSE SysDeb
    END
    END AS '31 to 60 Days',
    CASE
    WHEN (DATEDIFF(DD,RefDate,Current_Timestamp)) +1 > 60
    AND (DATEDIFF(DD,RefDate,Current_Timestamp)) +1 < 91 THEN
    CASE
    WHEN SysCred < > 0 THEN SysCred * -1
    ELSE SysDeb
    END
    END AS '61 to 90 days',
    CASE
    WHEN (DATEDIFF(DD,RefDate,Current_Timestamp)) +1 > 90
    AND (DATEDIFF(DD,RefDate,Current_Timestamp)) +1 < 121 THEN
    CASE
    WHEN SysCred < > 0 THEN SysCred * -1
    ELSE SysDeb
    END
    END AS '90 to 120 Days',
    CASE
    WHEN (DATEDIFF(DD,RefDate,Current_Timestamp)) +1 > 120
    THEN
    CASE
    WHEN SysCred != 0 THEN SysCred * -1
    ELSE SysDeb
    END
    END AS '120 Plus Days'
    FROM JDT1 T0
    INNER JOIN OCRD T1
    ON T0.ShortName = T1.CardCode
    AND T1.CardType = 'C'
    WHERE
    T0.IntrnMatch = '0'
    AND T0.BalDueDeb != T0.BalDueCred
    ORDER BY
    T1.CardCode,
    T0.TaxDate
    FOR BROWSE

  • Aged Debtors Report by Account Manager (Sales person)

    Hi experts
    I've created the following SQL Query to identify the ageing of balance outstanding on Open Sales Invoices. I'd like to include Credit Notes but do not have the expertise. Hope someone can help?
    Thanks in advance
    Derek
    SELECT T1.[CardCode] AS 'Cust Code', T1.[CardName] AS 'Customer', T1.[DocNum] AS 'Inv No', T1.[TaxDate] AS 'Doc Date', T1.[DocDueDate] AS 'Doc Due Date', T1.[DocCur] AS 'FX', T1.[DocTotalFC] AS 'Doc Total FX', T1.[DocTotal] AS 'Doc Total u20AC',T1.[DocTotal] - T1.[PaidSum] AS 'Bal Due u20AC', T0.[SlpName] AS 'AC Mgr',DATEDIFF(day,T1.DocDueDate,getdate()) AS 'Days Overdue' FROM OSLP T0  INNER JOIN OINV T1 ON T0.SlpCode = T1.SlpCode WHERE T1.[DocStatus] ='O'

    If you are on 8.8, this is a standard report?

Maybe you are looking for

  • My macbook wont detect that i plugged anything in the USB

    its not detecting my printer when it was every other day....help!!

  • Can i use flex components in flash?

    hi all, i recently downloaded flex and saw that the components have a much better feel than the components which ship with flash 8 pro. is there a way to use flex components in flash? any help would be appreciated. thanks, gaurav

  • OSX 10.5.8- Stuck at blue screen during startup

    After the Apple logo appears the screen goes to blue and stays there. I am also running BootCamp and can access Windows with out any problem, but I cannot get to the login screen for OSX. I have already reset my PRAM, reset my SMC, removed all Applic

  • Profiles are gone with Camera Raw 6.7 beta and DNG-Converter

    Hello, when i open a picture taken with the new Nikon D800 neither LR nor PS show the profiles i can see with the pictures taken from the D700. This also doesn't work when i convert them to dng with the beta version 6.7 of the dng-converter. My workf

  • IPhoto on an iPad Air: Save As?

    I opened an image from my iPad Air camera roll in my iPhoto App. Is there a way from inside my iPhoto App to save a duplicate to the camera roll or iPad Air? I get confused in iPhoto when I crop an image, how do I keep the original and work on a dupl