help concatenate

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

  • : 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.

Sign In or Register to comment.

Howdy, Stranger!

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

Categories

In this Discussion