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!

using query to send criteria to the report

Status
Not open for further replies.

iman1

Programmer
Aug 20, 2004
11
OM
I want to view specific records in the report using criteria in query but the problem is that I have one date field and I want to send two criteria of the same previous field to the report but at the same time I should send one criteria of the name field to the report (all that should be done in one query) but I don't know how to do it... ?
please help me.....!
 
How are ya iman1 . . . . .

Hmmmmmm . . . . not quite sure what ya want here.

Give an example!

Calvin.gif
See Ya! . . . . . .
 
the example ,

assume we have two tables as below :

tbldirectorates
application number
directorate
department
section

tblapplication
application number
date
number of computers
number of printers

now, if i want to display information in the report depand
on two these tables then i should use a query to get information with following fields "application number","directorate","number of computers" and "number of printers"....isn't it ?

but i don't want to display all the information in these tables .....!

what i mean is i want the user to enter name of a directorate and a period of time for example
directorate : information thecnology
date : 12/4/2004 to 12/8/2004
to get the "application number" "number of computers" "number of printers" for the specified directorate and the date that have been mentioned above.
what i think is i should (by using a query)enter one criteria to enter the directorate (information thecnology) and two other criteia to enter the date
first one :12/4/2004
second one :12/8/2004
but i don't know how to do it .
i hope you get it....!


 
Something like this ?
SELECT D.[application number], A.[number of computers], A.[number of printers], A.date
FROM tbldirectorates AS D INNER JOIN Dtblapplication AS A ON D.[application number] = A.[application number]
WHERE D.directorate = [Enter directorate]
AND A.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
 
This is exactly what I want.
Thank you so mush .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top