Datagrid Sorting Question - Deal With Empty Cells

R

rhungund

Hi All. I'm using VB.net in a webform with a datagrid. I need to sort
by column name which is working fine, but i need any row with an empty
result for the sorted column to show up at the end my resultset, not
the beginning. Any ideas??

so instead of: NULL A-Z

I need: A-Z NULL



thanks.

-RH
 
E

Elton Wang

Hi,

Suppose in field Note there are some Null and empty
values, think about following query:

Select EmployeeID, EmployeeName, Note from Employee
order by (Case When Note is Null Then 'zzzzzzz' When Note
='' Then 'zzzzzza' Else Note End)

HTH,

Elton Wang
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top