SELECT
CASE
WHEN ([column1] IS NULL) OR (LEN(LTRIM(RTRIM([column1]))=0 ) ) THEN
[column2]
ELSE
[column1]
END AS [PersonnalPrefix]
FROM [TableName]
WHERE ....
sqlGraduate = "SELECT CASE WHEN (GdtRank IS NULL) OR (LEN(LTRIM(RTRIM(GdtRank))= 0 ) ) THEN"
sqlGraduate &= " GdtTitle ELSE GdtRank "
sqlGraduate &= " END AS GdtRank "
sqlGraduate &= " FROM Graduate "