473,698 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select query for Ageing Report 30,60,90 days

11 New Member
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 20094
amitpatel66
2,367 Recognized Expert Top Contributor
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 New Member
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 Recognized Expert Top Contributor
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
Dan Andrews
1 New Member
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
9344
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 = <<Query_Name>> Once I create the report, I m trying to create labels to display the Report title in the Report Header section.
1
1419
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 value to a criteria on which the query/report is based. TIA for your help.
6
49357
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 entries on a form. Many thank, Dean...
1
5964
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 along the top row and the data items below it. This would give a better appreciation of changes over time. I apologise if I'm missing something obvious. Phil
0
7495
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 can make report from my database on the one sheet rather than querying each select statement ( I will use MS Query from the Excel) ========================================================= 1) select convert(varchar, create_date_time, 112) as Date,...
2
1966
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 Percent Male, Female, Smoker, # in age range # that use wheelchair or walker.
3
3343
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 transactional data back to a list of account numbers I have. (By matching the fields branch to Neab (Branch), and customer number (Pwanx) to Customer Number (Nean). This works fine but as soon as I add the suffix (field Pwasx), I get (Error 3049)....
8
4477
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 statement or end of statement on my select line , with and without the pertentheses at the end of my where clause. here is what I have, the query functions proporly in the access query builder. "SELECT .Date, .IDNumber, .Time," _ & "...
6
1567
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 displaying the reults??? DoCmd.openquery "qryETS Open orders", (WHAT GOES HERE?)
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7738
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.