472,353 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Select query for Ageing Report 30,60,90 days

11
Dears,

Help me how to create a ageing report for 30 days,60 days and 90 days, anyone can help me to have standard select query.

Opening Balance
30 days
60 days
90 days

thanks in advance,
moyoal
Mar 19 '08 #1
4 19753
amitpatel66
2,367 Expert 2GB
Dears,

Help me how to create a ageing report for 30 days,60 days and 90 days, anyone can help me to have standard select query.

Opening Balance
30 days
60 days
90 days

thanks in advance,
moyoal
Could you provide more detail on what exactly you want in your report?
More information (columns required, sample data) ?
Mar 19 '08 #2
moyoal
11
example

Header Details

customer No: xyz
From Date : 01-01-2007
to Date : 01-12-2007

cust Open Bal : <sum(credit-debit) before From Date i.e 01-01-2007>

================================================== ======
Line Details
Description Date Debit Credit
Debit 20-01-2007 2000 0
Credit 21-01-2007 0 1000

----------------------------------------------------------------------------------------------------------------
Total (Debit - Credit)
----------------------------------------------------------------------------------------------------------------

here what i want, credit of customer in last 30 days how much and in 60 days how much and 90 days how much

30 days Credit 60 days credit 90 days credit
100 500 400

please help me to create a query to get 30, 60 and 90 days credit amount

awaiting





Could you provide more detail on what exactly you want in your report?
More information (columns required, sample data) ?
Mar 19 '08 #3
amitpatel66
2,367 Expert 2GB
Try something like:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT SUM(amount) FROM table1 WHERE date_column BETWEEN SYSDATE - 30 AND SYSDATE
  3. UNION ALL
  4. SELECT SUM(amount) FROM table1 WHERE date_column BETWEEN SYSDATE - 60 AND SYSDATE
  5. UNION ALL
  6. SELECT SUM(amount) FROM table1 WHERE date_column BETWEEN SYSDATE - 90 AND SYSDATE
  7.  
  8.  
Mar 19 '08 #4
Please realize the amount of data you're talking about.

Expand|Select|Wrap|Line Numbers
  1.  SELECT hp.party_name,
  2.         SUM(apsa.amount_due_remaining),
  3.         SUM(apsa.amount_due_original),
  4.         CASE 
  5.             WHEN sysdate - rcta.trx_date >= 90 THEN 90
  6.             WHEN sysdate - rcta.trx_date >= 60 THEN 60
  7.             WHEN sysdate - rcta.trx_date >= 30 THEN 30
  8.             ELSE 00           
  9.         END GROUP
  10.  FROM  ar.hz_cust_accounts hca                                                
  11.  INNER JOIN ar.ra_customer_trx_all rcta ON hca.cust_account_id = rcta.bill_to_customer_id          
  12.  INNER JOIN ar.ar_payment_schedules_all apsa ON rcta.customer_trx_id = apsa.customer_trx_id
  13.  INNER JOIN ar.hz_parties hp ON hca.party_id = hp.party_id 
  14.  GROUP BY hp.party_name,
  15.         CASE 
  16.             WHEN sysdate - rcta.trx_date >= 90 THEN 90
  17.             WHEN sysdate - rcta.trx_date >= 60 THEN 60
  18.             WHEN sysdate - rcta.trx_date >= 30 THEN 30
  19.             ELSE 00           
  20.         END;
  21.  
Aug 27 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: amith.srinivas | last post by:
Hi all, From a word macro in VBA, I am trying to create a report in access DB. The report is based on a query with a parameter. I am using Set...
1
by: Stoney59 | last post by:
I have a rather simple database that I've designed a switchboard that runs several macros for producing a report that is based on a select query. I...
6
by: DeanL | last post by:
Hi All, How do you run a SELECT query from code? I know that DoCmd.RunSQL only works with action or DDF queries but I need to run a query from...
1
by: Phil | last post by:
Is it possible to swap rows and columns in select query output so that each record's data is displayed in a column? I want to collect data each day...
0
by: djflow | last post by:
Hi! II was wondering if you can help me with SQL query.. Below 7 separated select query works fine(only when they are retrieved separately) But...
2
by: sara | last post by:
I am helping a non-profit track their elder clients and care given to the clients. The organization would like a report that shows various info...
3
by: IntelliOfficer | last post by:
The data I am using was imported from Excel. The tables were then merged into one large table (3 million + records) and so cannot be re-exported into...
8
by: Trevor2007 | last post by:
I am trying to hard code the following select query into a select case statement ie (case1 <statment>, case 2 <statment>) but I getteing...
6
by: Proaccesspro | last post by:
Hello All, I have a report that is tied to a SELECT query.....Problem is, when I open the report, it also opens the results of the select query. ...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.