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.
Author |
Topic |
rnelsch
Starting Member
31 Posts |
Posted - 2012-10-25 : 17:22:47
|
I have the following in a query. How would I convert NULL(or blank) values in the Project.LeadSource column to show up as "BLANK" or "12345" for example? COALESCE is what I was thinking but not sure where to put it or format it? Select Project.LeadSource, Project.Department, Invoice.TotalAmount, Job.JobIDFrom Project Right Join Invoice On Project.ProjectID = Invoice.ProjectID Full Join PhoneCall On Project.JobType = PhoneCall.JobType And Invoice.JobID = PhoneCall.ForJobID Full Join Location On Invoice.LocationID = Location.LocationID Right Join Job On Invoice.JobID = Job.JobIDWhere Invoice.PostDate Between '@Request.islSelectBeginningDate~' And '@Request.islSelectEndingDate~'Ryan A Nelsch |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-25 : 17:27:14
|
replace Project.LeadSource withCOALESCE(NULLIF(Project.LeadSource,''),'BLANK')------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|