Query ability

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does a query ONLY pull from tables & other querys? Is it possible for the
query to request a beginning date from the user & use that information to
list the next 30 days following in order to match it up with a WHERE clause
in other records?

The reason I ask is because I have time records on my employees, and I have
Job records that I record the hours the employee worked on each job. Many
times the employee has a time record, but I do not have the hours worked
posted to a job. I would like to have the query request a beginning date and
then return the employee's time record for that date AND their Job record.
That way I can easily see when the Job record has not been recorded.
 
hi,

You could use query criteria provided from form fields or query parameter
prompts.

For example:
Using query prompt:
PARAMETERS dated DateTime;
SELECT [tbl_name].columnname
FROM tbl_name;

Using form field:
SELECT [tbl_name].ResolvedStatus, [tbl_name].date_column
FROM tbl_name
WHERE ((([tbl_name].date_column)=[forms]![test]![dated]));


Hope this helps
 
Does a query ONLY pull from tables & other querys? Is it possible for the
query to request a beginning date from the user & use that information to
list the next 30 days following in order to match it up with a WHERE clause
in other records?

Of course. This is called a "Parameter Query".

Create a query based on the table. On the date field put a criterion
of
= [Enter date:] AND <= DateAdd("d", 30, [Enter date:]

to get the date range; or - better - use an unbound control txtDate on
a form named (say) MyForm, and use a criterion
= [Forms]![MyForm]![txtDate] AND <= DateAdd("d", 30, [Forms]![MyForm]![txtDate])


John W. Vinson[MVP]
 
Back
Top