Click here to Skip to main content
11,488,877 members (78,435 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL2000 SQL-server-2005 SQL , +
Hi,

I have one small question, I am new so please help me.

In my project I have one text file which has zip4 and zip5 , I want to concatenate both the zip code but it has one problem, at some place zip4 is blank (not null) so when I used the derived column with ISNULL(ZIP_4) ? ZIP_5 : (ZIP_5 + "-" + ZIP_4) expression it will return the (zip5-) where zip4 is blank and I want only zip5 without - .

So please help me.
Posted 5-Sep-12 8:31am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

What data type is ZIP_4? Could it be a string type, which case you would want to count the number of characters with LEN().
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 489
1 OriginalGriff 278
2 Maciej Los 170
3 _Asif_ 145
4 Sascha Lefèvre 135
0 Sergey Alexandrovich Kryukov 9,308
1 OriginalGriff 8,375
2 Sascha Lefèvre 3,334
3 Maciej Los 2,996
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 24 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100