473,385 Members | 1,676 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,385 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 13973
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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:
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...
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...

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.