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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to Report Question

Status
Not open for further replies.

jschneider998

Technical User
Dec 20, 2002
8
US
Hello, I am trying to create a report based on a query. I have generated a query to specify what work has been done for what customers. The results give me a listing of company (customer) name, part worked on, and date work done. Now when I do a report is there a way that I can have the dates the work was completed on to show up as a range? For example we performed work for Company XYZ on 5/1/04, 5/2/04, 5/3/04, & 5/4/04 I was hoping to generate one entry on my report to show work completed 5/1/04 - 5/4/04. Is this possible and would this be programmed into the query or the report?

Thanks!
 
Hi, in the date field criteria for your query you could use
something like:

Between #5/1/2004#-1 And #5/4/2004#+1 or
Between #4/30/2004 And #5/5/2004#

You can also create two date fields on your form and reference those fields from the query:

Between forms!yourForm.txtDate1 and forms!yourForm.txtDate2

HtH
 
You can also use the following and the query for the report will prompt for the beginning and ending dates. The query will select the records properly and in the report you can use the exact Square Bracketed prompts as Control Source entries(including the sq. brackets to display the dates in textcontrols.

EXAMPLE: [RED]=[Enter Beginning date(mm/dd/yyyy): ][/RED]

Query criteria SQL code:

Code:
Between "#" & [Enter Beginning Date(mm/dd/yyyy): ] & "# and #" & [Enter Ending Date(mm/dd/yyyy): ] & "#"

Post back if you have any further questions.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top