none
separation street

    Dotaz

  • Hi, 

    I was anyone here who could help me separate the number from the street. 

    For example: "RIEGROVA 399";"Tulská 51", but street may also begin "6. KVĚTNA 481".

    output should be: one field: RIEGROVA,Tulská,6. KVĚTNA

    secend output: 399,51,481

    Thank you


    Boteviste 

    úterý 6. prosince 2016 10:00

Odpovědi

  • Hi,

    you have to define what pattern you want to use for street/number recognition based on the sample inputs you have.

    You may try to use something like "anything what follows the last space in the input string"

    @Number = RIGHT(@Address, CHARINDEX(' ', REVERSE(@Address)) - 1)

    or

    @Number = RIGHT(@Address, COALESCE(NULLIF(CHARINDEX(' ', REVERSE(@Address)), 0) - 1, 0))

    ...street is the rest ;-)


    Robert Haken, Microsoft MVP ASP.NET/IIS, HAVIT, s.r.o., www.havit.cz, http://knowledge-base.havit.cz

    neděle 27. srpna 2017 14:22
    Moderátor