Hi,I currently have this sql statementSELECT Code + '-' + Name + '-' + LegacyCode AS PrimaryCode, PrimaryCodeId FROM dbo.PrimaryCode ORDER BY Code + '-' + Name + '-' + LegacyCode[code]The problem is that if the LegacyCode is null then that row isn't displayed, I just get null back. What I want to do is something like[code]if LegacyCode = null [for a particular row] then SELECT Code + '-' + Name AS ...ORDER BY...elseSELECT Code + '-' + Name + '-' + LegacyCode AS ...ORDER BY...End
Problem is I have no clue how to do that
If anyone could shed some light on this I'd really appreciate it.ThanksBlackstar_solar