SQL Server 2008
I have 3 rows in a data table depending on the data I show suitable icons in a grid, the logic for this is a series of if thens in the code behind,
There is now a requirement to sort on these icons to group them together, Its just a simple column sort, but the question is I need a single column of data to sort on.
This is a sample of the data:
AdditionalActivityScheduled int (Number of activities)
AdditionalActivityOutstanding int (Number of above - completed ones
AdditionalActivityActive bit true / false if there is one Active
AdditionalActivityScheduled AdditionalActivityOutstanding AdditionalActivityActive
1 1 1
1 0 0
3 2 1
I can't think of a suitable way to munge all the above into a single column to sort on.
Once done I can rewrite the if / then statements in the code behind to use a select case on this new column, which will make the code simper.