Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to get rid of blank lines

Author  Topic 

Pinto
Aged Yak Warrior

590 Posts

Posted - 2005-04-15 : 10:16:37
The following SQL fills a dropdownlist on an asp.net web page. Some of the records have null in TicketNo and these are displayed as a blank line. In fact if any of the fields in my expression are null, this happens. How can I make them display. TIA

Dim strSQL As String = "Select DISTINCT CallNo,TicketNo,convert(varchar(20),CallNo) + '(OldRef:'+convert(varchar(20),TicketNo)+ ') 'Surname + ' :: ' + Call_desc as Ticket" _
& " from tblSL_Calls where Division = 'Environmental Services' and Service = 'BULKY HOUSEHOLD COLLECTIONS'" _
& " and Completed_time is null and Cancelled is null ORDER BY CallNo desc"

Vivaldi
Constraint Violating Yak Guru

298 Posts

Posted - 2005-04-15 : 10:39:26
couldn't you just wrap the
ticketno like this?

Coalesce(ticketno,'whatyouwanttodisplay')

________________________________________________

As the only Republican that likes the Green Party. I am a contradiction.
Go to Top of Page

Pinto
Aged Yak Warrior

590 Posts

Posted - 2005-04-15 : 10:49:10
Great - I just found that function by searching round, but you have made it very clear how to use it.
Go to Top of Page
   

- Advertisement -