473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 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 20022
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 rpt = Application.CreateReport rpt.RecordSource =...
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 need to design an input control that assigns a...
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 VBA and add variables into the query as defined by...
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 and display it in a query with each day's date...
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 I want to combined them together and so that i...
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 on ALL clients, such as: # in each town, # and...
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 excel for modification. I am trying to map the...
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 Compiler error: expected line number or label, or...
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. Is there a way to supress the Query from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.