Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

help concatenate

pejicipejici Member Posts: 2
I have the table caled (2002_MT_Basic_streets_tbl) in it row with fields as follows:[stname], [suffixes], [postdir], [municip], [true/false].
Now I need to join these fields into one field which I did by entering the expresion into the select query as follows:
Expr1: [stname] & " " & [suffixes] & " " & [postdir] & " " & "(" & [munic] & ")"

The result is :(example) "REMINGTON CRT (MI)"

Q1: How do I get rid of the extra spaces between CRT and (MI) if the field [postdir] is empty and?
Q2: How do I condition this query to display value for [munic] based on the value of [true/false] field(example if REMINGTON CRT (MI) THEN REMINGTON CRT, and if REMINGTON CRT (TO) THEN KEEP (TO))?

Comments

  • infidelinfidel Member Posts: 2,900
    : I have the table caled (2002_MT_Basic_streets_tbl) in it row with fields as follows:[stname], [suffixes], [postdir], [municip], [true/false].
    : Now I need to join these fields into one field which I did by entering the expresion into the select query as follows:
    : Expr1: [stname] & " " & [suffixes] & " " & [postdir] & " " & "(" & [munic] & ")"
    :
    : The result is :(example) "REMINGTON CRT (MI)"
    :
    : Q1: How do I get rid of the extra spaces between CRT and (MI) if the field [postdir] is empty and?
    : Q2: How do I condition this query to display value for [munic] based on the value of [true/false] field(example if REMINGTON CRT (MI) THEN REMINGTON CRT, and if REMINGTON CRT (TO) THEN KEEP (TO))?

    Which database are you using? If it's Oracle then you can use the DECODE function to help. If it's other than Oracle then I can't help you.

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    _ / http://forcoder.org / free ebooks and video tutorials about { C Ruby PHP Delphi C# Python Assembly Scratch Perl Visual Basic R Objective-C MATLAB Visual Basic .NET C++ Java PL/SQL JavaScript Swift Go Rust Clojure Awk Alice Crystal FoxPro Prolog Dart Hack COBOL Scheme Lua Fortran Lisp VBScript Bash ABAP Apex Kotlin F# LabVIEW Ada Scala Logo D ML SAS Erlang Transact-SQL Julia } _____

Sign In or Register to comment.