I have this if condition in my SQL Stored Procedure:
@isAlphabeticalSort bit = false
if(@isAlphabeticalSort = false)
ORDER BY V_CONSTAT_ACTUAL_DATES.DATE_TO_END
Else
ORDER BY V_CONSTAT_ACTUAL_DATES.JOB_NUMBER
but I get a few errors with this:
Invalid Column name false
Incorrect Syntax near 'ORDER'
I even tried adding the begin and end in between the if and the else and still I get the same errors....what am I doing wrong?