Solved

Urgent Date Question

Posted on 2001-06-23
2
175 Views
Last Modified: 2008-02-01
Hi,
I need to write the following query in Access:

I have a table called Loan,
I need to total the number of installments owing for a particular month or year where the balance is greater than zero, my problem being I don't know how to use the date functionality in Access the query needs to work in both 97 and 2000 but more importantly in 97.
I have the query I wrote in Oracle just quickly to get the results for June so that I could compare my Access results to ensure when I get the query in Access going my results are correct:

select sum(installment) Total from loan
where nextpaymntdate > last_day ('01-MAY-01')
and nextpaymntdate <= last_day('01-JUN-01')
and balance > 0;

I would like to get the user to enter the month or year they need the data from and the query to bring up just that month or year the user has chosen.  The date in Access format is e.g. 1-6-01.

If you can help a busy person it would be most appreciated
0
Comment
Question by:stressball
2 Comments
 

Accepted Solution

by:
Mikeh earned 50 total points
Comment Utility
this asks the user for two parameters startdate and endate and gives the total for installments

SELECT Sum(loan.Installments) AS SumOfInstallments
FROM loan
WHERE ((loan.NextPaymentDate>[startdate] And loan.NextPaymentDate<[enddate]) AND (loan.Balance>0));
0
 

Author Comment

by:stressball
Comment Utility
Thank you, thats the conclusion I came to but I am not getting any results returned, and I know I should as my Oracle query returns the correct results.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now