472,962 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,962 software developers and data experts.

Date Range Prompt for a Query

Hello,

I am trying to create a query that will prompt me to enter the
parameter value if beginning date and ending date.
I have created everything I need in the query, but I have to manually
go into SQL view to change the date range. This is what I have so far:

TRANSFORM Count([Program Information].ID) AS CountOfID
SELECT [Program Information].[Client ID], Count([Program
Information].ID) AS [Total Of ID]
FROM [Program Information]
WHERE (((Format([Date In],"Short Date")) Between #2/1/2007# And
#2/28/2007#))
GROUP BY [Program Information].[Client ID]
PIVOT Format([Date In],"Short Date");
Like I said I can get any date range I want by going in here and
changing the dates, but I want it to prompt me to enter the beginning
and end date when I click on the query. I would like to set this up so
others won't have to go into the SQL view and change stuff around. I
am worried that others might accidentally change something they are
not supposed to.

Thanks for any help you can provide.

Mar 11 '07 #1
2 13944
On 11 Mar 2007 07:54:57 -0700, sixdeuce62 wrote:
Hello,

I am trying to create a query that will prompt me to enter the
parameter value if beginning date and ending date.
I have created everything I need in the query, but I have to manually
go into SQL view to change the date range. This is what I have so far:

TRANSFORM Count([Program Information].ID) AS CountOfID
SELECT [Program Information].[Client ID], Count([Program
Information].ID) AS [Total Of ID]
FROM [Program Information]
WHERE (((Format([Date In],"Short Date")) Between #2/1/2007# And
#2/28/2007#))
GROUP BY [Program Information].[Client ID]
PIVOT Format([Date In],"Short Date");

Like I said I can get any date range I want by going in here and
changing the dates, but I want it to prompt me to enter the beginning
and end date when I click on the query. I would like to set this up so
others won't have to go into the SQL view and change stuff around. I
am worried that others might accidentally change something they are
not supposed to.

Thanks for any help you can provide.
1) Change the query parameter to:
WHERE [Date In] Between [Enter Start Date] And
[Enter End Date]

2) In addition, in a Crosstab query you MUST also enter the parameter
and it's datatype in the Query Parameter dialog box.
In Query Design View, click on Query + Parameters.
Enter:
[Enter Star Date] DateTime
[Enter End Date] DateTime
in their appropriate columns. Include the brackets.

Save and runt the query.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Mar 11 '07 #2
Thanks for the help!!
On Mar 11, 12:00 pm, fredg <fgutk...@example.invalidwrote:
On 11 Mar 2007 07:54:57 -0700, sixdeuce62 wrote:


Hello,
I am trying to create a query that will prompt me to enter the
parameter value if beginning date and ending date.
I have created everything I need in the query, but I have to manually
go into SQL view to change the date range. This is what I have so far:
TRANSFORM Count([Program Information].ID) AS CountOfID
SELECT [Program Information].[Client ID], Count([Program
Information].ID) AS [Total Of ID]
FROM [Program Information]
WHERE (((Format([Date In],"Short Date")) Between #2/1/2007# And
#2/28/2007#))
GROUP BY [Program Information].[Client ID]
PIVOT Format([Date In],"Short Date");
Like I said I can get any date range I want by going in here and
changing the dates, but I want it to prompt me to enter the beginning
and end date when I click on the query. I would like to set this up so
others won't have to go into the SQL view and change stuff around. I
am worried that others might accidentally change something they are
not supposed to.
Thanks for any help you can provide.

1) Change the query parameter to:
WHERE [Date In] Between [Enter Start Date] And
[Enter End Date]

2) In addition, in a Crosstab query you MUST also enter the parameter
and it's datatype in the Query Parameter dialog box.
In Query Design View, click on Query + Parameters.
Enter:
[Enter Star Date] DateTime
[Enter End Date] DateTime
in their appropriate columns. Include the brackets.

Save and runt the query.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -

- Show quoted text -

Mar 18 '07 #3

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

Similar topics

5
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular...
6
by: BlackFireNova | last post by:
Using Access 2002 I am writing a report which draws data from several different tables. I can't link all the tables in a query, as some can not be related without truncating the data. I plan...
12
by: Steve Elliott | last post by:
I have a query set up to gather together data between two specified dates. Shown in the query column as: Between #24/09/2004# And #01/10/2004# Is it possible to enter several different date...
4
by: gregork | last post by:
I have a query to return records within a date range. I have a prompt to enter a start and end date which works fine as long as I enter the date in mm/dd/yy format (even though the date field is in...
3
by: manning_news | last post by:
Using A2K. I've been asked to modify a report currently requiring only one date parameter to now accept a date range. The main report has 2 subreports and is not bound to a table or query. The...
67
by: PC Datasheet | last post by:
Transaction data is given with date ranges: Beginning End 4/1/06 4/4/06 4/7/06 4/11/06 4/14/06 4/17/06 4/18/06 4/21/06 426/06 ...
1
by: isetea | last post by:
Hi, I want to create a from where user can select from a date range / type in a date range to get only data from an underlying query within this range. This should overwrite the existing criteria...
4
Sandboxer
by: Sandboxer | last post by:
I want to be able to program Access to provide for me, by individual day, what my contract obligations are to my customers. Will Access recognize all the individual days in between a date range...
19
by: phill86 | last post by:
Hi I am re-posting this thread because it has become very confusing and I have got some way to solving the problem so it is a slightly different question from the initial thread. here is the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.