Re: Parameters or no parameters - CASE statements
From: Khan (usammik_at_yahoo.com)
Date: 05/07/04
- Next message: Steven Wilmot: "Re: Reporting Services"
- Previous message: Khan: "Re: Running DOS batch file in SQL Server Job"
- In reply to: Not Me: "Parameters or no parameters - CASE statements"
- Next in thread: Alan: "Re: Parameters or no parameters - CASE statements"
- Messages sorted by: [ date ] [ thread ]
Date: 7 May 2004 08:28:40 -0700
do you mean when @name is blank, name shouldn't show up in the result?
I basically use case for column selection if I have few column values to show.
"Not Me" <Not.Me@faker.fake.fa.kee> wrote in message news:<c7d9pk$ujl$1@ucsnew1.ncl.ac.uk>...
> 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
- Next message: Steven Wilmot: "Re: Reporting Services"
- Previous message: Khan: "Re: Running DOS batch file in SQL Server Job"
- In reply to: Not Me: "Parameters or no parameters - CASE statements"
- Next in thread: Alan: "Re: Parameters or no parameters - CASE statements"
- Messages sorted by: [ date ] [ thread ]