View Full Version : 2 parameters in one query


MissAnna
05-14-2002, 05:41 PM
Hello,

I have a query containing two parameters, one is for a date range and the other for an identifier. it looks like this

In the 'or' line of the date column:
Is Null or Between [start date] and [end date]

and in the 'criteria' line of the identifier column:
[Enter Identifier]

Unfortunately I cannot get both these parameters to work ithin the one query, if I don't enter a date (i.e. is null) the identifier parameter works, if I enter the dates and the identifier, then the identifier is not shown and I get all the identifiers...

Can anybody advise me on this?

Thanks!
Miss Anna

Pat Hartman
05-15-2002, 05:41 PM
The "Is Null" part of the condition is referring to the date field in the table, not the parameter date fields. You'll need to post the SQL so we can see what the problem is.

MissAnna
05-15-2002, 07:33 PM
Ah, that makes sense. Thanks Pat!

here is the SQL

SELECT tblPayments.[Payment Type], tblPayments.Date, tblPayments.[Cost Centre], tblPayments.Account, tblPayments.Identifier, tblPayments.[Supplier Name], tblPayments.[GST Free], tblPayments.[GST Included], [GST paid]*10 AS [GST Exempt], [GST Included]/11 AS [GST paid], tblPayments.Description
FROM tblPayments

WHERE (((tblPayments.[Cost Centre])=[Enter Cost Centre])) OR (((tblPayments.Date) Between [Enter start date] And [Enter end date]))
ORDER BY tblPayments.Date;


Much appreciated,
Anna