Wednesday, March 21, 2012

ORDER BY

hi,

i' ve Drop Down List with sorted catagory and Data Grid that cange according to selected item in drop down list ... i need to send the selected item as value to SELECT statment, so i 've send (option) as a value

"SELECT [userstory].* FROM [userstory] WHERE ([userstory].[rel_id] = @.rel_id) ORDER BY @.options "

but there is an error:

The SELECT item identified by the ORDER BY number 1 contains a variable as part of the expression identifying a column position. Variables are only allowed when ordering by an expression referencing a column name

You should order by a column name and not a param. Soif your field is payDate in your DB then you would do order by payDate .|||

thanks for answering

bt if i need to use variable as ordered by coz i've send for 1st time order by status 2nd order by risk .. an so on..

can i?

No comments:

Post a Comment