|
 |
access thread: Help with an Access Query
Message #1 by "Robert J. McCluskey" <rjmccluskey@h...> on Tue, 3 Apr 2001 20:17:52
|
|
I have built an Access 2000 query that creates an aging of accounts
receivable records.
The fields that create the aging are expressions of the following form:
Current: IIf([Invoice Date] >=Date()-30,[Invoice Amount],0)
1 to 30 Days Past Due: IIf([[Invoice Date] >=Date()-60 AND
[Invoice Date]<=Date()-31,[Invoice Amount],0)
31 to 60 Days Past Due: IIf()
61 to 90 Days Past Due: IIf()
91 and Over Past Due: IIf()
I would like to not "hard code" the Date() function (which, of course,
returns the system date) and instead have the user enter a date as in a
parameter query.
My question is: how do I get each field to accept a date entered only
once, i.e. a single parameter that would be read by each of the
expressions?
Thanks for your help!
Bob McCluskey
rmccluskey@m...
rjmccluskey@h...
Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Tue, 03 Apr 2001 15:31:43 -0700
|
|
You can do that with a query parameter--just replace the calls to Date()
with a user prompt in square brackets--e.g.,
Current: IIf([Invoice Date] >=[Please enter a reference
date]-30,[Invoice Amount],0)
1 to 30 Days Past Due: IIf([[Invoice Date] >=[Please enter a
reference date]-60 AND
[Invoice Date]<=[Please enter a reference date]-31,[Invoice Amount],0)
Access should ask for the parameter once & then substitute the value the
user inputs everyplace the parameter is called out.
HTH,
-Roy
-----Original Message-----
From: Robert J. McCluskey [mailto:rjmccluskey@h...]
Sent: Tuesday, April 03, 2001 1:17 PM
To: Access
Subject: [access] Help with an Access Query
I have built an Access 2000 query that creates an aging of accounts
receivable records.
The fields that create the aging are expressions of the following form:
Current: IIf([Invoice Date] >=Date()-30,[Invoice Amount],0)
1 to 30 Days Past Due: IIf([[Invoice Date] >=Date()-60 AND
[Invoice Date]<=Date()-31,[Invoice Amount],0)
31 to 60 Days Past Due: IIf()
61 to 90 Days Past Due: IIf()
91 and Over Past Due: IIf()
I would like to not "hard code" the Date() function (which, of course,
returns the system date) and instead have the user enter a date as in a
parameter query.
My question is: how do I get each field to accept a date entered only
once, i.e. a single parameter that would be read by each of the
expressions?
Thanks for your help!
Bob McCluskey
rmccluskey@m...
rjmccluskey@h...
|
|
 |