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 |
|
gpsk7
Starting Member
4 Posts |
Posted - 2005-09-28 : 02:55:21
|
| I am running the following querry to display the sum of length of 2 fields:SELECT (datalength(field1) + datalength(field2))FROM Table1This query fails if it encounters a NULL value in any of the field. So is there any way around to check the NULL value in the fields before adding the lengths and if it founds NULL then add '0' to the length.cheers. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-28 : 03:03:21
|
| Try thisSELECT (datalength(IsNull(field1,'')) + datalength(IsNull(field2,'')))FROM Table1MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|