You can't do this. There is no such thing as a
"Boolean" variable.
IF NOT newCommand <<- Error starts here
Change it to IF ( newCommand = 0)
Bill
-----Original Message-----
From: bounce-aspnet-databases-58376 aspadvice.com
[mailto:bounce-aspnet-databases-58376 aspadvice.com] On Behalf Of
James
Macdiarmid
Sent: Wednesday, December 12, 2007 10:14 AM
To: aspnet-databases aspadvice.com
Subject: [aspnet-databases] T-SQL help
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
|