473,799 Members | 3,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1403
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(Service ID, 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.Service ID=Uses.UServic eID
and then filter on the month by using BETWEEN

Jan 16 '07 #2

pi********@hotm ail.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(Service ID, 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.Service ID=Uses.UServic eID
and then filter on the month by using BETWEEN

pi********@hotm ail.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(Service ID, 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.Service ID=Uses.UServic eID
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.

tblFoodAssistan ce (pkFoodAssistan ceID) (fkClientID), AssistanceDate,
FoodSource...et c.

tblFinancialAss istance (pkFinanceAssis tanceID) (fkClientID),
PaymentDate, CheckNumber, PaymentAmount.. .etc.

tblMentorAssist ance (pkMentorSessio nID) (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
4304
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 put in some kind of a variable based input for the parameter like '6/30/' & year(now()), it doesn't work. Is there any way to concatenate text and a variable at the input of a parameter query. THIS IS DRIVING ME NUTS. PLEASE HELP. :)
3
3130
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) look at results in datasheet view If I want to run the query again, I must d) click to close the datasheet view e) click on the query f) enter the parameter value
2
6517
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. I then want to search through the records and select those with dates (as caluclated above) within a user defined range, and so I am using a parameter query. However, this query returns dates outside of the range and appears to have particular...
5
1710
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 user types in 08/07/06, the records of 08/05/06, 08/06/06 and 08/07/06 will all appear in the qry. I have the following code, which is real basic, but I am running into "the expression is typed incorrectly or is too complex etc".
4
1488
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 this will vary depending on the Date How would you query the top 10 projects in regards to most amount of dollars where each project has to use the latest date in regards to
16
3167
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 parameter will not be changed - so don't worry. 2. It tells the implementor and the maintainer of this function that the parameter should not be changed inside the function. And it is for this reason that some people advocate that it is a good idea to...
5
1234
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 the total number of pitches thrown by each pitcher on a user-specified time frame (<) and, if possible, count the occurences of records for that pitcher as well (would be the # of starts this season). Any help is appreciated!
3
1806
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 radio buttons. Depending on the selection a different query will run. The problem I am incurring is when I am querying more than one table. As an example: SELECT tbl_Claim.Txt_InsuredName, tbl_Claim.Date_DOL, tbl_Claim.Mem_PolNo,...
25
4465
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 two queries. Great! However, when I close it and re-run the report, it prompts me for a third parameter: HOTSTICK_FAILURE.DATE_ENTERED. The first half is a table name; the second half is a table field name. The query this report is based off...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10268
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...
0
10031
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7571
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
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
5467
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
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
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
3762
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.