Parameters or no parameters - CASE statements

From: Not Me (Not.Me_at_faker.fake.fa.kee)
Date: 05/06/04


Date: Thu, 6 May 2004 13:07:22 +0100

Hi,

I would like to build a query that would take a number of parameters which
will be used for search clauses. What I would like tho is that if the
parameters are not given then no effect is had on the results. For example
if given the parameter @name I would like 'where name = @name' and if @name
was blank then i'd like either nothing, or just name = '%'.

I've tried various ways of putting case statements in but keep getting
syntax errors.. where exactly are you allowed to use cases?

Cheers,
Chris



Relevant Pages

  • Re: One Insert statement, no looping, creates 2 records?
    ... Is there any chance a distributed query is involved? ... you can see this when the first execution generates the ... >REALLY odd, tho, is that the debug display only shows once, even tho it's ... and the debug display ...
    (microsoft.public.sqlserver.programming)
  • Re: Coworker modified base query, now form does not allow access to query.
    ... Do you have a backup copy of the database? ... Yes, we do, but what I wound up doing was createing a new form via the ... to test out the query. ... its still mildly bugging me about that form, tho... ...
    (microsoft.public.access.forms)
  • Re: id number
    ... If you want to do it, in the combo box query have both fields even tho ... In the after update event, ... Then store it where you want. ...
    (comp.databases.ms-access)

Loading