Re: Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!
From: MGFoster (me_at_privacy.com)
Date: 03/10/04
- Next message: WonderingWhy: "Nested Queries with a Parameter"
- Previous message: dlel: "Need parameter query results to populate form and subform fields"
- In reply to: Kahuna: "Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!"
- Next in thread: Kahuna: "Re: Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!"
- Reply: Kahuna: "Re: Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Mar 2004 22:12:13 GMT
Kahuna wrote:
> As a follow-up I have tried using the following code
>
> Between (([tblAnom_Register].[anom_date_raised]) Like IIf(IsNull([Enter
> First Possible Date Raised]),"*",[Enter First Possible Date Raised])) And
> (([tblAnom_Register].[anom_date_raised]) Like IIf(IsNull([Enter Second
> Possible Date Raised]),"*",[Enter Second Possible Date Raised]))
>
> Though the syntax seems to be correct the query returns no records with
> theithr blank parameters entered or qualified dates.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You could probably try using the Nz() function. E.g.:
Syntax: Nz(test value, substitute value)
If the "test value" is NULL then the "substitute value" is used.
SQL WHERE clause:
WHERE tblAnom_Register.anom_date_raised BETWEEN Nz([Enter First Date
Raised], #1/1/100#) And Nz([Enter Second Possible Date Raised],
#1/1/9999#)
If the user doesn't enter a date the default dates are substituted. I
used the highest & lowest default date values that can be stored in an
Access db. Therefore, if the user doesn't enter any dates in the
parameter prompts, all records should be shown.
Caveat: Any anom_date_raised that is NULL will not be selected.
HTH,
- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQE+SvoechKqOuFEgEQJXawCg71bUANdieBz/ZNQrzwzidc6b2xwAmwR6
KDZhWNUIUe0ZKqBtul/sLA7q
=oDhM
-----END PGP SIGNATURE-----
- Next message: WonderingWhy: "Nested Queries with a Parameter"
- Previous message: dlel: "Need parameter query results to populate form and subform fields"
- In reply to: Kahuna: "Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!"
- Next in thread: Kahuna: "Re: Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!"
- Reply: Kahuna: "Re: Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|