Re: Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!
From: Kahuna (none_at_gonewest.com)
Date: 03/11/04
- Next message: david epsom dot com dot au: "Re: SQL call to VBA, named or omitted parameters syntax?"
- Previous message: david epsom dot com dot au: "Re: Query is too complex (run-time error)"
- In reply to: MGFoster: "Re: Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 11 Mar 2004 08:53:58 -0000
Thanks MG, that might just do it. I'll play with it this pm.
Cheers
-- Kahuna ------------ "MGFoster" <me@privacy.com> wrote in message news:1pM3c.13575$%06.5071@newsread2.news.pas.earthlink.net... > 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: david epsom dot com dot au: "Re: SQL call to VBA, named or omitted parameters syntax?"
- Previous message: david epsom dot com dot au: "Re: Query is too complex (run-time error)"
- In reply to: MGFoster: "Re: Follow-up : Parameters using 'Between Date 1 & Date 2' - Need to use 'Like' too!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|