James:
What is newCommand declared as?
>From the error message, it sounds as if it is not a
value that SQL Server
can convert into "boolean" for your comparison.
--
Brett Stinson
brett.stinson gmail.com
On 12/12/07, James Macdiarmid <jmacdiarmid caci.com> wrote:
>
> This is a snip from a larger Sproc and I'm getting the
below error. Any
> ideas what might be going wrong here or should I
include the entire sproc?
>
> if type = 1
> BEGIN
> IF NOT newCommand
<<- Error starts here
> BEGIN
> select rtrim(fy) as fy
FROM
> (
> select 'X' as fy
> union all
> select fy from
[dbo].[lu_fy] with
> (nolock)
> ) x
> order by isnumeric(fy)
> END
> ELSE
> BEGIN
> SELECT DISTINCT [fy]
> FROM [dbo].FC_FY WITH
(NOLOCK)
> WHERE [fy] IN (SELECT
[fy] from [dbo].
> [LU_FY] WHERE [currency] = 'CURRENT')
> ORDER BY [fy]
> END
> END
>
>
> Msg 4145, Level 15, State 1, Procedure
p_FC_GET_APC_EDIT_FILTER, Line 22
> An expression of non-boolean type specified in a
context where a condition
> is expected, near 'BEGIN'.
> Msg 156, Level 15, State 1, Procedure
p_FC_GET_APC_EDIT_FILTER, Line 31
> Incorrect syntax near the keyword 'ELSE'.
>
> Thanks in advance!
>
>
> Jim MacDiarmid
> CACI
> 4795 Meadow Wood Lane
> Chantilly, VA. 20151-2222
> Voice (703) 679-5454
>
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com
>
Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com
|