AP Aging report day by day
Hi,
Can some one help me with below query.
Posting Date, Doc #, Doc Status (Open Olny), Card Code, Card Name, Supplier ref. No, Doc Total, Total Paid, Balance Due, Today due, tomorrow due, day after tomorrow, like same till month end. (for salected period) (T0.[DocDueDate] >= [%0] and T0.[DocDueDate] <=[%1]).
Regards,
Suresh
Hi,
Check this if it helps you for start :
select t1.docdate As 'Posting Date', t1.DocNum as 'Document #', t1.DocStatus as 'Status',
t1.CardCode as 'BP Code', t1.cardname as 'BP Name', t1.numatcard as 'Reference Number',
t1.doctotal as 'Document Total',t1.paidsum as 'Paid Amount',
t1.DocTotal-t1.PaidSum as 'Balance Due',
datediff(dd,t1.docdate, getdate())as 'Overduedays'
from JDT1 T3 inner join OPCH t1 on t3.transid = t1.transid and t3.shortname <> t3.account
inner join PCH1 t5 on t5.docentry = t1.docentry
where t1.DocStatus = 'O' and t3.refdate >= '2011.01.01' and t3.refdate <= '2011.12.31'
order by datediff(dd,t1.docdate,getdate())
If you need Overduedays in different column, then you have to check Pivot.
Kind Regards,
Jitin
SAP Business One Forum Team
Similar Messages
-
Aging Report, variable for Days Outstanding
Does anyone know the Variable for the 'No. of Days Outstanding' in the Aging report?
Thanks,
MarisaHi Marisa......
It is Variable No. 40 for no. of Days Outstanding.......
Hope this will work.....
Regards,
Rahul -
Can using query create aging report for GL Account
Hi all expert,
I have a challenge scenario which customer request print out aging report for the following GL Account.
This is not a business partner account. However, customer want display like aging report.
30 days aging report for the following GL accounts by projects:-
i) WIP (Work In Progress) account
ii) Accrued Revenue account
iii) Accrued Cost account
Examples:
Current Balance 30 day 60 day 90 day 120 day
Account WIP 10000 2000 3000 5000 0
Any idea or example given? If yes, can you provide a query here?
Regards,
Eric TanHi Eric
In standard SAP Business One this is difficult as the reports are 2 dimensional. To achieve this you will need to write multiple select statements into a temporary table and then select the final result from the temp table. Here is a sample for you to test:
USE [*DATABASE_NAME*]
GO
/****** Object: StoredProcedure [dbo].[REPORT_NAME] Script Date: 04/24/2009 13:17:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[*REPORT_NAME*]
as
set nocount on
begin
DECLARE @Day_no varchar(2)
DECLARE @Month_no varchar(2)
DECLARE @Year_no varchar(4)
DECLARE @Start_Date Datetime
SET @Day_no = DAY(GetDate())
SET @Month_no = MONTH(GetDate())
SET @Year_no = YEAR(GetDate())
SET @Start_Date = @Year_No + '/' + @Month_no + '/' + @Day_no -- + '/' + @Year_No
IF OBJECT_ID(N'tempdb..#CRDAGEING', N'U') IS NOT NULL
drop table #CRDAGEING
SELECT T0.[CardCode] AS [CardCode], T0.[CardName] AS [CardName], -T0.[Balance] AS [Balance], CAST(0 AS MONEY) AS [Current], CAST(0 AS MONEY) AS [1Week], CAST(0 AS MONEY) AS [2Weeks], CAST(0 AS MONEY) AS [3Weeks], CAST(0 AS MONEY) AS [4Weeks], CAST(0 AS MONEY) AS [5Weeks], CAST(0 AS MONEY) AS [6Weeks], CAST(0 AS MONEY) AS [Over6Weeks], CAST(0 AS MONEY) AS [Avg3Months], CAST (0 AS MONEY) AS [Onhand] INTO #CRDAGEING FROM OCRD T0 WHERE T0.[CardType] = 'S' -- and T0.[CardCode] <> '' --and T0.[DocDate] >= @FromDate AND T0.[DocDate] <= @ToDate
INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] <= @Start_Date GROUP BY T1.[ShortName]
INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] >= DATEADD(DAY,1,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,8,@Start_Date) GROUP BY T1.[ShortName]
INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,8,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,15,@Start_Date) GROUP BY T1.[ShortName]
INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,15,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,22,@Start_Date) GROUP BY T1.[ShortName]
INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,22,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,29,@Start_Date) GROUP BY T1.[ShortName]
INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,29,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,36,@Start_Date) GROUP BY T1.[ShortName]
INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,36,@Start_Date) and T1.[DueDate] <= DATEADD(DAY,43,@Start_Date) GROUP BY T1.[ShortName]
INSERT dbo.#CRDAGEING SELECT T1.[ShortName], NULL, 0, 0, 0, 0, 0, 0, 0, 0, -SUM(T1.[BalDueDeb] - T1.[BalDueCred]), 0, 0 FROM JDT1 T1, OCRD T2 WHERE T2.[CardType] = 'S' and T2.[CardCode] = T1.[ShortName] and T1.[DueDate] > DATEADD(DAY,43,@Start_Date) GROUP BY T1.[ShortName]
SELECT SR.[CardCode], MAX(SR.[CardName]), SUM(SR.[Balance]) AS [BalanceOwing], SUM(SR.[Current]) AS [Current], SUM(SR.[1Week]) AS [1Week], SUM(SR.[2Weeks]) AS [2Weeks], SUM(SR.[3Weeks]) AS [3Weeks], SUM(SR.[4Weeks]) AS [4Weeks], SUM(SR.[5Weeks]) AS [5Weeks], SUM(SR.[6Weeks]) AS [6Weeks], SUM(SR.[Over6Weeks]) AS [Over6Weeks] FROM dbo.#CRDAGEING SR GROUP BY SR.[CardCode] ORDER BY SR.[CardCode]
END
Go to Microsoft SQL Studio manager and select your company database. Then expand the list and select Programmability > Stored Procedures. Right click on Stored Procedures and select New Stored Procedure. Copy the above code over the code in the edit window and change the database name as well as report name. Then select Execute to create the stored procedure. If you make changes, remember to change the word CREATE to ALTER (with other words CREATE for the first execute, and ALTER thereafter). Then in SAP Business One create a new query and leave everything blank. Click on execute and select the pencil to change to edit mode. Remove the words SELECT and type in EXEC REPORT_NAME (change the REPORT_NAME to the name you used in SQL). Then execute again and the results will be displayed in SAP Business One.
Let me know if you get stuck. Remember the above is an example and will need to be changed to use your tables and fields as required. The basic idea is to move across by one column with each select statement. So for example the first select statement does the CURRENT column, the second one the 30DAYS column, and so on.
Kind regards
Peter Juby -
Variable of No of Days Outstanding in Vendor Liabilities Aging Report
Dear Experts,
Which Variable No is use for No of Days Outstanding in Vendor Liabilities Aging Report?
Thanks,
Srujal PatelYes I m asking for No of Days Outstanding and I know thats the day.
But as per My Formula only Days are calculate.
1. Eg, 10/11/2011 Due Date 14/11/2011 Aging Date
Result is 4 Days Out Standing thats right.
But
2. Eg. 10/09/2011 Due Date 14/11/2011 Aging Date
Result is 4 Days outstanding thats wrong
Actual result is 65 Days
So, which formula I have use in PLD to get proper result -
Hi Experts
How to do the selection for Ageing Report in Over 30days, Over 211 days Above 30 days, Total Over 30 days explain detailed with offest values.
Edited by: Sk Babu999 on Dec 29, 2010 2:01 PMHi:
Take a look at the paper by Surendra Reddy.
"Calculating the Ageing of the Materials"
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30f15839-0cf1-2b10-c6a7-ebe68cc87cdc?quicklink=index&overridelayout=true
Another example is the paper by Neelesh Kumar Jain.
"Creating Bucket Scenarios using Exception Aggregation (SAP Netweaver 7.0 BI)"
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c09f49c2-7448-2c10-ac92-d75f263a0dce?quicklink=index&overridelayout=true
Regards,
Francisco Milán. -
Ageing report-Days range as an I/p
Based on posting date we designed an Ageing report
0 30 60 90 120 ....
now users want day range as an i/p
means => user will i/p day range say 40 then report will be executed for 0 40 80 120 .....
if i/p for day range is 60 then 0 60 120 180 ......
previously we resticted the key figure by posting date variable by settng the offset range
like RFK1--- 0balance restricted by var (0-30)
RKF2--- 0balance restricted by var (31-60) and so on...
before we were able to hardcore it but with the current requirment we have to take user i/p var and then accordingly ageing report will be generated..
pl let us know the right wayokay...
we have created one char : ZOFFSET (no of days) and included in the target on which ageing report is based on...,,,, after that we crearted a user exit variable Zvar_offset(ready for i/p) on char ZOFFSET.....
In ZXRSRU01,
when zpost_dt {zpost_dt is the user exit variable ,ready for i/p,defined for posting date}
if i_step = 1
date_low = zpost_dt.
date_high = zpost_dt - Zvar_offset. {not sure whether this logic will work or not!!!}
CLEAR L_S_RANGE.
L_S_RANGE-LOW = date_low.
L_S_RANGE-high = date_high.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
even after this we cant achieve the motive, as zpost_dt will have range value high and low after user exit execution but in our query its a single value i/p (user will give only one posting date) ,,,
also what abt other buckets (other ranges for the same offset) because code will return only one range however we want more ranges for different intervals -
No. of days outstanding variable in aging report for SAP 8.8
Hi All,
Would like to check whether anyone knows what are the variable numbers for 'No of days outstanding' column in aging report? I would like to include this field in the detail aging report print out. Thanks.Hi....
Check this link: [PLD_Variables_8.8|https://websmp105.sap-ag.de/~sapidb/011000358700000449672010E/HowTo_PLD_Variables_88.zip]
Regards,
Bala -
180 days - customer aging report
Hi Experts,
I'm required to revise the Customer Receivable Aging Report from Business Partners > Business Partner Reports > Aging > Customer Receivable Aging. the Standard report shows only up to 120+ days. We require 180+ days. Could you help me with the work around on this.Hi Sachin,
Could you please send your SQL (and maybe also Crystal Report) for SAP B1 "Customer Aging Report" to me too?
I am trying to write the SQL which will mimic the SAP B1 standard report, and then add a few more fields because Management wants these.I need to do a lot of Excel gymnastics each time I produce an ageing. I am looking for an SQL Query that will give the same total as the standard report. It must also list all outstanding invoices individually and their amounts, as well as all other unreconciled items.
Send me what you have (SQL). I'll try to modify it to suit my requirements. As I'm newbee, it is much easier for me to start from some existing code.
Thanks a lot
LEONLAI -
Has any one else noticed that the aging by days formula is strange?
The formula used by SAP is Aging date - due date plus 1 day.
This means that a document with a due date of 31st August is aged as 31 days when the aging report is run aged as 30 September.
To my mind, the document is 30 days overdue and should be included in the 0-30 day bucket not the 31-60 day bucket?Hello Sen,
Standard report MB54 is available to check vendor consignment stock, but not with aging.
Transparent table MKOL (Vendor Special stock) contains the record creation date so you can use that one to calculate age of that material, but I am not sure that if you already have stock for vendor consignment and receive another consignment in that case, it will add-up in the same record. You can play around it.
The another option is you can take help from MSEG and MKPF table for the same.
Hope this helps.
Regards
Arif Mansuri -
How to calculate Age of Debt in Days
Hi experts.
Basically this is my requirement. I need to produce a column in my query to display the age of debt in days.
I have inserted Characteristic Value Variable <b>Key Date, 0P_KEYDA</b> in my query. User will give an input to this variable and the report will be produced as at that date.
Now, there is a column called<b> Age of Debt in Days</b> in my query. The formula is as follow:
<i><b>Age of Debt in Days = Key Date - Document Date.</b></i>
I cannot define it earlier during data staging because the Key Date would be dynamic and I wouldn't know the value before the query is executed.
Can someone let me know on how can that be accomplished?
Thanks in advance.Hi,
followig is the sample code fro reading value from other variable:
you can search the forums on how to write a variable exit
this is the implementation of the cusotmer exit for variable 2:- var2
METHOD var2.
DATA: LS_RANGE_IN TYPE RRS0_S_VAR_RANGE,
LS_RANGE_OUT TYPE RRRANGESID,
L_SCAL_DATE TYPE D.
process different steps in the Exit
CASE I_STEP.
Exit Call before User Input
WHEN 1.
Exit Call after User Input
WHEN 2.
READ TABLE I_T_VAR_RANGE WITH KEY VNAM = 'keydate' INTO
LS_RANGE_IN.
VALUE FOR TYPE CUSTOMER EXIT FROM keydate TO var2
IF SY-SUBRC EQ 0.
CLEAR:L_SCAL_DATE.
L_SCAL_DATE = LS_RANGE_IN-LOW.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = L_SCAL_DATE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
Exit Call to check the variable values at the end
if raise the exception no_processing the variable screen will appear
again (see note 492504).
WHEN 3.
RAISE no_processing.
ENDCASE.
ENDMETHOD var2.
in brief:
processing type 2 : i.e after the variable input
read i_t_var_range (this structure store all the variable values) where key = keydate(var enterd by user)
get the date and append it to the current variable.
you have to write this in Cmod ( it is a bit lengthy procedure, so search in sdn for this)
hope this helps. -
Investigate Accounts receivable Aging (30/60/90 days overdue)
Hi Experts,
What ia aging report, and how to Investigate Accounts receivable Aging (30/60/90 days overdue)...plz tellme step by step analysis.
InInventory Aging reports also......its very orgent
Regards
VenkatHi use the following T,codes
S_ALR_87012168 - Due Date Analysis for Open Items
S_ALR_87012175 - Open Items - Customer Due Date Forecast
chandra -
Is there a report to display tha balances of a G/L account day by day?
Hi All,
I'm looking for a report to to display tha balances of a G/L account day by day (the cumulative balances too)
T.code FS10N shows me the balances of a G/L account period by period, but not day by day.
Could anyone help me?
Thanks
GandalfHi Jeyakanthan ,
I've checked it, but the balances aren't available in that report.
Gandalf -
Generate AWR Report automatically every day
Hi Friends,
I would like to generate AWR Report automatically every day. How do i do it.
The Start Time will be 00:00 of Previous day and the end Time will be : 00:00 of current day. The File format is html.
Currently i am using awrrpt.sql to generate report manually and i would like to achieve it automatically,I am not sure how to pass the values of start and end time (From which table i can get the values)?
Regards,
DBHi, DB.
You may use the below sql script , the sql script generates the AWR report for the duration of 2 days in HTML.
So you change
1) the where condition as per your requirement,
2) report name in sql script,
3) and convert it as shell or bat script based on your environment, and schedule it in your OS job scheduler / crontab.
=-=-=-=-
connect / as sysdba
REM set termout off
variable snap1 number
variable snap2 number
COLUMN starthr new_value bhr
COLUMN endhr new_value ehr
COLUMN crdate new_value cdt
begin
select
distinct min(s.snap_id)
into :snap1
from dba_hist_snapshot s
where to_char(trunc(end_interval_time,'HH24'),'HH24') = to_char(trunc(sysdate,'HH24'),'HH24')-2 and trunc(end_interval_time)=trunc(sysdate);
select
distinct max(s.snap_id)
into :snap2
from dba_hist_snapshot s
where to_char(trunc(end_interval_time,'HH24'),'HH24') =to_char(trunc(sysdate,'HH24'),'HH24') and trunc(end_interval_time)=trunc(sysdate);
end;
COLUMN starthr new_value bhr
COLUMN endhr new_value ehr
COLUMN crdate new_value cdt
select to_char(trunc(sysdate, 'HH24'),'HH24')-2 starthr,
to_char(trunc(sysdate, 'HH24'),'HH24') endhr,
to_char(trunc(sysdate),'DD-MON-YYYY') crdate
from dual;
define begin_snap=:snap1
define end_snap=:snap2
define report_name=/orashare1/reports/awrreport/AWRRPT_PROD_1_${1^^}_${EXDATE}_mor.html
define report_type = 'html';
@@?/rdbms/admin/awrrpt.sql
exit -
Generate day-to-day report of system usage
Is there any way to generate a report of the system usage on a day-to-day basis in adobe connect? i would like to do this as we are hosting an adobe connect server for a university with only 250gb of space and would like to see which days are used the most. Thanks.
CurtisUnfortunately, you are at the wrong forum; this one is just for discussions on the forums the
mselves. The Acrobat Connect forum is here:
http://forums.adobe.com/community/connectpro/acrobat_connect
Extra line break kindly provided by the non updated software of the forums -
Hi All
i am trying to get a legitimate vendor Aging report from within SAP
The 2 reports that I am currently looking at are:
S_ALR_87012085 - Vendor Payment History with OI Sorted List
S_ALR_87012084 - Open Items - Vendor Due Date Forecast
But both these do not bring out the output the way i want it - and i tried changing the output control and it still doesnt bring out the report as i want it - I want a report like the S_ALR_87012178 for customers, with output control 1, 6 and a 0 - which gives me a logical list of the aged customers.
Is there one like this for vendors too? Any suggestions?
Thank you
RukshanaHi Ruksaana,
You can customize the vendor report to show the items overdue per vendor by using the following steps
1. Create a form using T Code - FKI4
In this form ( two-axis structure) provide the details for each column as per your Client requirement - Due from 0 - 30 days
etc. You can create a column (using formula method) at the end by adding the previous columns, this will give you total
amount of overdue items for each vendor
2. Create a report using T Code - FKI1
Based on the Form created in the above step. Make additional selections based on client requirements like document type,
company code, account type, currency etc. Execute the report.
The following link will give provides detail steps for the creation of the aforementioned form and report.
Re: AR aging report (summary by customer)
Hope this helps.
- Sadha. -
This report has been extended from an existing query that has been posted on this forum.
This report is an aging report for ALL trasnactions, both open and closed.
Is it possible to modify this query to report on OPEN / unreconciled trasnactions only?
select T0.shortname,T2.cardcode 'Customer Code',T2.cardname 'Name',T2.U_BU, T2.U_DEPT, sysdeb 'Debit Amount',syscred 'Credit Amount',
case T0.transtype
when '13' then 'INV'
when '14' then 'AR CN'
when '24' then 'INCOMING'
else 'Other'
end 'Type',
T1.BaseRef'Trans #',
case T0.transtype
when '13' then
(Select Comments from OINV where OINV.Transid=T1.Transid)
else '-'
end 'Inv.Rem.',
(Select SeriesName From NNM1 Where Series=T1.DocSeries and ObjectCode=T0.TransType)'Series',
T0.Ref1,
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' ,
CASE
when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 < 31
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "0-30 days",
case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 30
and (datediff(dd,T0.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,T0.refdate,current_timestamp))+1 > 60
and (datediff(dd,T0.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,T0.refdate,current_timestamp))+1 > 90
then
case
when syscred= 0 then sysdeb
when sysdeb= 0 then syscred * - 1
end
end "90 + days"
from JDT1 T0
Inner Join OJDT T1 On T1.TransId=T0.TransId
left outer join
OCRD T2 ON T2.cardcode =T0.shortname where
T2.cardtype = 'c' and T0.intrnmatch = '0' and
T2.U_Bu = %0and T2.U_Dept = %1
ORDER BY T2.CARDCODE, T0.taxdate
Thanks in advanced LisaThanks for the feedback Jule - I have changed the query as is as below
Unfortunately, the query is still reporting ALL transactions not just unreconciled transations.
Would be grateful for any assistance.
Cheers Lisa
select T0.shortname,T2.cardcode 'Customer Code',T2.cardname 'Name',T2.U_BU, T2.U_DEPT, balscdeb 'Debit Amount',balsccred 'Credit Amount',
case T0.transtype
when '13' then 'INV'
when '14' then 'AR CN'
when '24' then 'INCOMING'
else 'Other'
end 'Type',
T1.BaseRef'Trans #',
case T0.transtype
when '13' then
(Select Comments from OINV where OINV.Transid=T1.Transid)
else '-'
end 'Inv.Rem.',
(Select SeriesName From NNM1 Where Series=T1.DocSeries and ObjectCode=T0.TransType)'Series',
T0.Ref1,
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' ,
CASE
when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 < 31
then
case
when balsccred <> 0 then balsccred * - 1
else balscdeb
end
end "0-30 days",
case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 30
and (datediff(dd,T0.refdate,current_timestamp))+1< 61)
then
case
when balsccred <> 0 then balsccred * - 1
else balscdeb
end
end "31 to 60 days",
case when ((datediff(dd,T0.refdate,current_timestamp))+1 > 60
and (datediff(dd,T0.refdate,current_timestamp))+1< 91)
then
case
when balsccred <> 0 then balsccred * - 1
else balscdeb
end
end "61 to 90 days",
CASE
when (DATEDIFF(dd,T0.refdate,current_timestamp))+1 > 90
then
case
when balsccred= 0 then balscdeb
when balscdeb= 0 then balsccred * - 1
end
end "90 + days"
from JDT1 T0
Inner Join OJDT T1 On T1.TransId=T0.TransId
left outer join
OCRD T2 ON T2.cardcode =T0.shortname where
T2.cardtype = 'c' and
T2.U_Bu = [%0]and T2.U_Dept = [%1]
ORDER BY T2.CARDCODE, T0.taxdate
Maybe you are looking for
-
Is there any way to select all mail messages and delete them?
I get lots of mail, and most of it I don't keep, or keep over on my MacBook. Is there a way to select all the Mail messages and delete them, or do I need to go through them one at a time? many thanks! Jeannette <Edited by Host>
-
Issue attaching files in Adobe Reader from a form created in Adobe Acrobat Pro 9 Extended
Hello all, I am having issues- big ones- please help! I have created a simple form in Adobe Acrobat Pro 9 extended version that will be made available in a local drive for our salesmen to open not online or in html format- fill in and send back to th
-
Trouble with low light action shots on 70d
I just went from a T3i to a 70D. I seem to have trouble with action shots in low light situations, any suggestions on setting... Solved! Go to Solution.
-
Executing BW Queries in BSP Page
Hi, Can someone provide source code taking one query and accessing it through the BSP event handler page? Will the BSP Page can replicate the same functionality of the BEX web application? Can i have drilldown,graphics everything in BSP applica
-
this has been happening the last week or so on my PC laptop Acer I am running 6.0 it happening about every 5n min I have lots of tabs open most of the time; but this has been my pattern of use