Loading ...
Sorry, an error occurred while loading the content.

UPDATE query question.

Expand Messages
  • Troy
    I m attempting to take the contents of field1 and field2 and put them into field3 (with 10 spaces between the fields) by way of an UPDATE query. For instance,
    Message 1 of 4 , Feb 25, 2005
    • 0 Attachment
      I'm attempting to take the contents of field1 and field2 and put them
      into field3 (with 10 spaces between the fields) by way of an UPDATE
      query. For instance, field1 = "Homer" and field2 = "Simpson". When the
      query's run, field3 should equal "Homer Simpson".

      This doesn't work...

      UPDATE myTable SET field3 = field1 & " " & field2

      Can anyone give me a clue here as to the easy way to accomplish this
      goal??

      Thanks much....Ooogy
    • Razvan Socol
      It would be very useful if you could tell us which platform you use. In SQL Server (and maybe Oracle, too) this should work: UPDATE myTable SET field3 = field1
      Message 2 of 4 , Feb 26, 2005
      • 0 Attachment
        It would be very useful if you could tell us which platform you use.
        In SQL Server (and maybe Oracle, too) this should work:
         
        UPDATE myTable SET field3 = field1 + ' ' + field2
         
        Razvan
        ----- Original Message -----
        From: Troy
        Sent: Friday, February 25, 2005 11:46 PM
        Subject: [SQLQueriesNoCode] UPDATE query question.



        I'm attempting to take the contents of field1 and field2 and put them
        into field3 (with 10 spaces between the fields) by way of an UPDATE
        query. For instance, field1 = "Homer" and field2 = "Simpson". When the
        query's run, field3 should equal "Homer Simpson".

        This doesn't work...

        UPDATE myTable SET field3 = field1 & " " & field2

        Can anyone give me a clue here as to the easy way to accomplish this
        goal??
      • Michael Gerholdt
        For Oracle substitute double-pipe || for the + _____ In SQL Server (and maybe Oracle, too) this should work: UPDATE myTable SET field3 = field1 + + field2
        Message 3 of 4 , Feb 26, 2005
        • 0 Attachment

          For Oracle substitute double-pipe || for the +

           


          In SQL Server (and maybe Oracle, too) this should work:

           

          UPDATE myTable SET field3 = field1 + ' ' + field2

        • Troy
          The + was the ticket I was looking for. New language, new concatenation symbol. Thanks.
          Message 4 of 4 , Feb 27, 2005
          • 0 Attachment
            The "+" was the ticket I was looking for. New language, new
            concatenation symbol. Thanks.

            --- In SQLQueriesNoCode@yahoogroups.com, "Razvan Socol" <rsocol@f...>
            wrote:
            > It would be very useful if you could tell us which platform you use.
            > In SQL Server (and maybe Oracle, too) this should work:
            >
            > UPDATE myTable SET field3 = field1 + ' ' + field2
            >
            > Razvan
            > ----- Original Message -----
            > From: Troy
            > To: SQLQueriesNoCode@yahoogroups.com
            > Sent: Friday, February 25, 2005 11:46 PM
            > Subject: [SQLQueriesNoCode] UPDATE query question.
            >
            >
            >
            >
            > I'm attempting to take the contents of field1 and field2 and put them
            > into field3 (with 10 spaces between the fields) by way of an UPDATE
            > query. For instance, field1 = "Homer" and field2 = "Simpson". When the
            > query's run, field3 should equal "Homer Simpson".
            >
            > This doesn't work...
            >


            > UPDATE myTable SET field3 = field1 & " " & field2
            >
            > Can anyone give me a clue here as to the easy way to accomplish this
            > goal??
          Your message has been successfully submitted and would be delivered to recipients shortly.