Parameters

  • Thread starter Thread starter Cillies
  • Start date Start date
C

Cillies

Hi! I wish to have two parameters in a query,

Between[Start Date]AND[End Date]
&
[Enter Client Name]
This is no problem and works fine, each time I open the
report I fill in the parameters and recieve the required
results. The problem is;

I need to be fit to JUST select a client and leave the
date range out. This should return all info about that
Client.

And
I need to be fit to JUST select a date search which should
return all clients within the entered date range.

All I can do is select [Client]and [Date] and get the
aquired info.

So from this I tried using the OR operator with Is Null in
both parameters, but with this all I was fit to retrieve
was, all the info about the client irrelevant of the date
search.
 
Hi, I did something similar. my query parameters were for
a Name, Project and a date range. If the option All was
selected from cboName of cboProjects then all the data
should be returned. I think this will help you or at least
give you and idea. heres is the sql view.

SELECT tblName.NameID, tblName.Names, tblName.Dt,
tblTRPrj.TRProjectsID, tblTRPrj.ProjectName,
tblTRPrj.ProjActDesc, tblTRPrj.PrjHours,
tblTRPrj.ExtraTasks, tblTRPrj.MOO, tblTRPrj.NCC, NZ
([PrjHours])+NZ([ExtraTasks])+NZ([Moo])+NZ([NCC]) AS
SumOfHours
FROM tblName INNER JOIN tblTRPrj ON tblName.NameID =
tblTRPrj.NameID
WHERE (((tblName.Dt) Between [Forms]![frmViewRpts].[Form]!
[txtBeginDate] And [Forms]![frmViewRpts].[Form]!
[txtEndDate]) AND (([Forms]![frmViewRpts].[Form]!
[cboNames]) Like "(All)") AND (([Forms]![frmViewRpts].
[Form]![cboProjects]) Like "(All)")) OR (((tblName.Names)=
[Forms]![frmViewRpts].[Form]![cboNames]) AND ((tblName.Dt)
Between [Forms]![frmViewRpts].[Form]![txtBeginDate] And
[Forms]![frmViewRpts].[Form]![txtEndDate]) AND (([Forms]!
[frmViewRpts].[Form]![cboNames]) Not Like "(All)") AND
(([Forms]![frmViewRpts].[Form]![cboProjects])
Like "(All)")) OR (((tblName.Names)=[Forms]![frmViewRpts].
[Form]![cboNames]) AND ((tblName.Dt) Between [Forms]!
[frmViewRpts].[Form]![txtBeginDate] And [Forms]!
[frmViewRpts].[Form]![txtEndDate]) AND
((tblTRPrj.ProjectName)=[Forms]![frmViewRpts].[Form]!
[cboProjects]) AND (([Forms]![frmViewRpts].[Form]!
[cboNames]) Not Like "(All)") AND (([Forms]![frmViewRpts].
[Form]![cboProjects]) Not Like "(All)")) OR
(((tblName.Names)=[Forms]![frmViewRpts].[Form]![cboNames])
AND ((tblName.Dt) Between [Forms]![frmViewRpts].[Form]!
[txtBeginDate] And [Forms]![frmViewRpts].[Form]!
[txtEndDate]) AND (([Forms]![frmViewRpts].[Form]!
[cboNames]) Not Like "(All)") AND (([Forms]![frmViewRpts].
[Form]![cboProjects]) Like "(All)"));
 
Does that mean that I have to have a form opened anytime I
want to open this report.

The thing is that I don't have an all option anywhere and
not to sure as to how I would put one in.
 
Back
Top