Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Range Query Report

Status
Not open for further replies.

kdibricida

Technical User
Jun 15, 2005
24
I currently run a report based off a query for a user specified date range.

Is there anyway to have the date range automatically placed on the report somewhere?

Here is my query.

SELECT [All DC Security].[Date/Time], [All DC Security].Date, [All DC Security].[Event ID], [All DC Security].Type, [All DC Security].Category, [All DC Security].User, [All DC Security].Source, [All DC Security].Feed, [All DC Security].Message, [All DC Security].Time
FROM [All DC Security]
WHERE ([All DC Security].Date BETWEEN [Input Start Date] AND [Input End Date]) AND ((([All DC Security].[Event ID])=624 Or ([All DC Security].[Event ID])=628 Or ([All DC Security].[Event ID])=627 Or ([All DC Security].[Event ID])=632 Or ([All DC Security].[Event ID])=644 Or ([All DC Security].[Event ID])=671));
 
SELECT [All DC Security].[Date/Time], [All DC Security].Date, [All DC Security].[Event ID], [All DC Security].Type, [All DC Security].Category, [All DC Security].User, [All DC Security].Source, [All DC Security].Feed, [All DC Security].Message, [All DC Security].Time[!],[Input Start Date] AS StartDate, [Input End Date] AS EndDate[/!]
FROM [All DC Security]
WHERE ([All DC Security].Date BETWEEN [Input Start Date] AND [Input End Date]) AND [All DC Security].[Event ID] In (624,628,627,632,644,671);

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Sorry I am not following how the date range gets on the report
 
How about a textbox with a Control Source set to:
[tt]="Report for " & Min([Date]) & " To " & Max([Date])[/tt]

PS You will run into problems if you use reserved words such as Date as a field names.

List of reserved words in Access 2002 and Access 2003
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top