Datagrid Sorting Question - Deal With Empty Cells

  • Thread starter Thread starter rhungund
  • Start date Start date
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
 
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

Back
Top