Re: Dynamic WHERE statement
From: Jim Warren (jmwarren_at_msu.edu)
Date: 01/29/05
- Next message: Skeleton: "XP SP2"
- Previous message: Colin Barnhorst: "Re: Disk Partitioning"
- In reply to: Admiral Q: "Re: Dynamic WHERE statement"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 28 Jan 2005 19:19:41 -0500
Sorry about that, it was a very long day, about 2pm time slowed noticeably
"Admiral Q" <Star_Fleet_Admiral_Q(NOSPAM)@(SPAMNOT)hotmail.com> wrote in
message news:u4$W1bZBFHA.1400@TK2MSFTNGP11.phx.gbl...
> In case you haven't figured it out, this is a "windows XP setup and
> deployment group" and not a "how to code SQL2k group". Your best bet is
> to
> repost in one of the many SQL newsgroups for the "gurus" there to answer
> your question. ;-)
>
> --
> Star Fleet Admiral Q @ your service!
>
>
> "Jim Warren" <jmwarren@msu.edu> wrote in message
> news:uRdZFGZBFHA.936@TK2MSFTNGP12.phx.gbl...
>> If I pass a variable to @Cost_Center that is 'SMS', 'SMP' OR 'ALL'
>> 'ALL' will return records that have either 'SMS' or 'SMP' in them.
>> Now I am using an if statement that has the entire SQL statement in the
> body
>> of the
>> conditional.
>>
>> I tried this
>>
>> Where
>>
>> IF (@Cost_Center = 'All')
>>
>> Begin
>>
>> code...
>> and i.cost_center in ('SMS','SMP')
>>
>> End
>>
>> ELSE
>>
>> Begin
>>
>> code...
>> and i.cost_center = @Cost_Center
>>
>> End
>>
>>
>> Thanks
>> Jim
>>
>>
>
>
- Next message: Skeleton: "XP SP2"
- Previous message: Colin Barnhorst: "Re: Disk Partitioning"
- In reply to: Admiral Q: "Re: Dynamic WHERE statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|