D
Dan Nash
hi guys
I have a contacts table, with firstname, surname and company.
In showing this list, I want to order the data so that its ordered by
surname, firstname, company.
So...
"SELECT * FROM Contacts ORDER BY SurName, FirstName, Company"
This wors fine, however some records dont have a firstname or surname, and I
want these records to appear alphabetically in the list, with the company
name. Is there any way in sql of saying ORDER BY Surname Else if Surname =
"" ORDER BY Company?
The only way I can think of doing it is to copy the Company field into the
SurName field if it's blank when created. However, this seems fairly long
winded. Is there any easier way?
Any ideas much appreciated
Dan
I have a contacts table, with firstname, surname and company.
In showing this list, I want to order the data so that its ordered by
surname, firstname, company.
So...
"SELECT * FROM Contacts ORDER BY SurName, FirstName, Company"
This wors fine, however some records dont have a firstname or surname, and I
want these records to appear alphabetically in the list, with the company
name. Is there any way in sql of saying ORDER BY Surname Else if Surname =
"" ORDER BY Company?
The only way I can think of doing it is to copy the Company field into the
SurName field if it's blank when created. However, this seems fairly long
winded. Is there any easier way?
Any ideas much appreciated
Dan