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

Getting data for 7 or 30 days

Status
Not open for further replies.

MConlin

Technical User
Apr 28, 2005
5
0
0
US
Hi,
I am new to this forum and I know this is probably a simple question but, I have a query set up to get data from a table I created and have been able to run reports based on the query. What I need is to be able to use this same query and get all the data for a week or a month at a time. Any ideas? Here is the SQL from the query I have:

SELECT [JOB CODE ENTRY].DATE, [JOB CODE ENTRY].[USER ID], [JOB CODE ENTRY].DEPT, [JOB CODE ENTRY].[TOTAL TIME], [JOB CODE ENTRY].[JOB CODE], [JOB CODE ENTRY].UNITS, [JOB CODES].[STD CODE], [JOB CODES].[UNITS PER HOUR], [JOB CODE ENTRY]![TOTAL TIME]*[JOB CODES]![UNITS PER HOUR] AS [TOTAL EXPECTED], [UNITS]/[TOTAL EXPECTED] AS [%], [EmployeeLastName] & " " & (Left([EmployeeFirstName],1)) AS NAME, [JOB CODES].DESCRIPTION
FROM ([JOB CODE ENTRY] INNER JOIN [JOB CODES] ON [JOB CODE ENTRY].[JOB CODE] = [JOB CODES].[JOB CODE]) INNER JOIN [SHORT ID FOR JOB CODE ENTRY] ON [JOB CODE ENTRY].[USER ID] = [SHORT ID FOR JOB CODE ENTRY].[SHORT ID]
WHERE ((([JOB CODE ENTRY].DATE)=[Enter Date]));
 
WHERE [JOB CODE ENTRY].DATE Between [Enter Start Date] And [Enter End Date];

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Try something like
Code:
PARAMETERS [Enter Start Date] Date, [Enter End Date] Date;

Select etc.


WHERE [JOB CODE ENTRY].[DATE] BETWEEN [Enter Start Date] AND [Enter End Date]
BTW: You should not use "Date" as a field name because it is the name of a built-in function.
 
Thank you for the help, looks like that is going to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top