Link to home
Start Free TrialLog in
Avatar of Derek Brown
Derek BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Query filter

What is the difference between:
Like Left([Forms]![ProjectForm]![Details].[Form]![FireRating],4) & "*" and
Like nz(Left([Forms]![ProjectForm]![Details].[Form]![FireRating],4) & "*","*")

How would I get a different result
What I would like is:
Like [Forms]![ProjectForm]![Details].[Form]![FireRating]  or isnull.

What I'm trying to acheive is, filter records by the exact content of the form field unless the field is empty (Is null and "") in which case show all the records.
Avatar of als315
als315
Flag of Russian Federation image

You always can add separate field to your query equal to

Isnull([Forms]![ProjectForm]![Details].[Form]![FireRating])

with OR criteria True

to your main criteria

You would want:


[Forms]![ProjectForm]![Details].[Form]![FireRating] Is Null or  Left([Forms]![ProjectForm]![Details].[Form]![FireRating],4) & "*"


Jim.

Avatar of Derek Brown

ASKER

Hi Jim

I'm using access 2002 but that does not work for me I have to use

On this occasion I don't need the Left and ,4)

So finally this works.  Like nz(([Forms]![ProjectForm]![Details]![FR]),"*")

I can't quite understand why I can't use Like [Forms]![ProjectForm]![Details]![FR]) Or IsNull

Hi Als315 could not get that to work either
SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Both
Thanks Als315 Git I can see what I was doing wrong.

Thanks Jim Got it