Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8479621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:04:59+00:00 2026-06-10T19:04:59+00:00

I Have a scenario that i need to select a row and concatenate the

  • 0

I Have a scenario that i need to select a row and concatenate the values into the single variable. The problem is if certain column is null then the part has to be left out. But in my scenario it gives a Hyphen which i used with the empty space can some one help me with this.

I tried this…..

SELECT  @Location_Details = CONVERT(VARCHAR, ISNULL(O.CSS_No, ''))
                + '-' + CONVERT(VARCHAR, ISNULL(STREET.STREET_START_X, ''))
                + '-' + CONVERT(VARCHAR, ISNULL(STREET.STREET_START_Y, ''))
                + '-' + CONVERT(VARCHAR, ISNULL(STREETDES.STREET_DESCRIPTOR,
                                                '')) + '-'
                + CONVERT(VARCHAR, ISNULL(STREETDES.LOCALITY_NAME, '')) + '-'
                + CONVERT(VARCHAR, ISNULL(STREETDES.TOWN_NAME, '')) + '-'
                + CONVERT(VARCHAR, ISNULL(HW.Description, '')) + '-'
                + CONVERT(VARCHAR, ISNULL(Add_stree.Additional_Street_Location_Text,
                                          ''))
        FROM    dbo.[order] O WITH ( NOLOCK )
                LEFT JOIN dbo.Order_USRN_Header USRN WITH ( NOLOCK ) ON USRN.Order_No = O.Order_No
                LEFT JOIN DatabaseName.dbo.STREET STREET WITH ( NOLOCK ) ON STREET.USRN_NO = USRN.USRN_No
                LEFT JOIN DatabaseName.dbo.STREET_DESCRIPTOR STREETDES WITH ( NOLOCK ) ON STREETDES.USRN_NO = USRN.USRN_No
                LEFT JOIN dbo.High_Way_Authority HW WITH ( NOLOCK ) ON HW.HW_Authority_ID = STREET.SWA_ORG_REF
                LEFT JOIN [DatabaseName].dbo.additional_STREET Add_stree WITH ( NOLOCK ) ON USRN.USRN_No = Add_stree.USRN
        WHERE   O.Order_No ='123456'

this gives the result like….

-565654-48798-MAIN STREET-Chennai-Tamilnadu-India-

Can some one help in this…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:05:01+00:00Added an answer on June 10, 2026 at 7:05 pm

    Use ISNULL(O.CSS_No+'-', '') instead of ISNULL(O.CSS_No, '') + '-', etc

    Also, there’s probably no need to convert a field which is already a string to a varchar each time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scenario that, I am creating dynamic html content and I need
I have a scenario that my load balancer translates port 80 from outside into
I need a query that will fetch a single item before a certain Id
Scenario : I have about 14000 word documents that need to be converted from
So I have a scenario where there are 1-8 people that i need to
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
I have a scenario that looks like this: #include <algorithm> using namespace std; //
I have a scenario that I haven't been able to solve: I'm toying around
I have a scenario that when I try to access a hash key using
I have a scenario outline table that looks like the following: Scenario Outline: Verify

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.