473,288 Members | 1,729 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,288 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 13967
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.