473,396 Members | 2,016 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,396 software developers and data experts.

Parameter query date dilemma

As an Access learner, I'm tearing my hair out over what is probably a
simple problem. I hope someone can help.

I have a table for Clients (tbl.Clients with pkClientID).

Each client may use one, two or three services (tblFood, tblMoney, and
tblMentoring). Each of these tables contains a field, fkClientID.

Within each of the three service tables there is a date field
indicating each occasion a client used the service. A client may use
any or all of the services multiple times.

I need to identify and count those clients who used ANY of the services
within a specific date range to answer the question "How many clients
were served during this time period?"

A collateral question is, "How many clients were served for the FIRST
time during this time period?"

If it isn't clear, a client should be counted only once during any time
period, regardless of the number of services utilized or the number of
occasions on which the service was utilized.

Thanks.

Jan 16 '07 #1
2 1369
Sounds like a design flaw, because this is a simple query.
You should have 3 tables, not 2. Oh, and don't use punctuation in
object names, it will bite you. You can use underscores, but most
punctuation marks have very definite meanings in Access.

Client(ClientID (PK), ClientName...)
Service(ServiceID, ServiceText)
Uses(UClientID (PK1), UServiceID (PK2), DateUsed, ...)

Then the queries are easy.

add the 3 tables to the QBE grid, join on

Client.ClientID=Uses.UClientID
Service.ServiceID=Uses.UServiceID
and then filter on the month by using BETWEEN

Jan 16 '07 #2

pi********@hotmail.com wrote:
Sounds like a design flaw, because this is a simple query.
You should have 3 tables, not 2. Oh, and don't use punctuation in
object names, it will bite you. You can use underscores, but most
punctuation marks have very definite meanings in Access.

Client(ClientID (PK), ClientName...)
Service(ServiceID, ServiceText)
Uses(UClientID (PK1), UServiceID (PK2), DateUsed, ...)

Then the queries are easy.

add the 3 tables to the QBE grid, join on

Client.ClientID=Uses.UClientID
Service.ServiceID=Uses.UServiceID
and then filter on the month by using BETWEEN

pi********@hotmail.com wrote:
Sounds like a design flaw, because this is a simple query.
You should have 3 tables, not 2. Oh, and don't use punctuation in
object names, it will bite you. You can use underscores, but most
punctuation marks have very definite meanings in Access.

Client(ClientID (PK), ClientName...)
Service(ServiceID, ServiceText)
Uses(UClientID (PK1), UServiceID (PK2), DateUsed, ...)

Then the queries are easy.

add the 3 tables to the QBE grid, join on

Client.ClientID=Uses.UClientID
Service.ServiceID=Uses.UServiceID
and then filter on the month by using BETWEEN
I apologize for not explaining clearly.

I have FOUR separate tables:

tblClients (pkClientID), ClientName, Address, City...etc.

tblFoodAssistance (pkFoodAssistanceID) (fkClientID), AssistanceDate,
FoodSource...etc.

tblFinancialAssistance (pkFinanceAssistanceID) (fkClientID),
PaymentDate, CheckNumber, PaymentAmount...etc.

tblMentorAssistance (pkMentorSessionID) (fkClientID), SessionDate,
SessionLength, Mentor...etc.

While it's straightforward to select dates using tblClients and any one
of the other three tables, it falls apart if I consolidate in a single
query the ClientID, AssistanceDate, PaymentDate and SessionDate.

What I want to do is to wind up with a single query that will identify
whether a client utilized any or all of the services during a specified
period of time, preferably using a single BETWEEN...AND parameter
dialog.

Jan 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: MX1 | last post by:
Simpler way to ask question from my previous post. I wrote a query and it has a paramter field in it. I want to enter a date with the current year. If it I put in 6/30/2003, it works great. If I...
3
by: thomas goodwin | last post by:
I have a query which asks for a parameter value to execute it. To see the results I have to: a) click on the query -- the "Enter Parameter Value" window pops up. b) enter the parameter value c)...
2
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result....
5
by: vinfurnier | last post by:
Hi - I've been struggling to produce a working parameter query that will allow the end user to type in any date (mm/dd/yy) and obtain the records of the previous 2 days. In other words, if the...
4
by: ree321 | last post by:
Say you have table with that is filled with the amount of dollars for a project for given dates. i.e. 3 columns - Project, Amount, Date A project could have multiple entries in the tabke but...
16
by: hzmonte | last post by:
Correct me if I am wrong, declaring formal parameters of functions as const, if they should not be/is not changed, has 2 benefits; 1. It tells the program that calls this function that the...
5
by: JSaks | last post by:
I'm attempting to create a query that will sum data based on a certain field. i.e. Column 1-Date Column 2-Pitches Thrown on That Day Column 3-Pitchers Name I'd like the query to count...
3
by: vljones | last post by:
I am either having an extended blond moment or have been looking at this too long. This is a basic question but I simply cannot get my head around the solution. I have a Search form with grouped...
25
by: DanicaDear | last post by:
I am trying my hand at my first ever Access report. It is based on a two parameter query (start date, end date). When I use the report wizard and click "view report" the report prompts me for the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
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...

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.