Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    191

    Unanswered: Add value to a field

    select docnum,VERSION, docname, author, docloc
    from MHGROUP.DOCMASTER
    WHERE C1alias like 'xxxxx'
    and C2alias LIKE 'xxxx'
    order by docnum


    I would like to see only the Word Washington appear in the docloc column.

    Is it something like: docloc print 'Washington'

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Sample data, please?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jul 2004
    Posts
    191
    DocNoc Version DocName Author DocLoc2005346.0 1 Westport Corrected Report CHHHJC Washington2005346.0 2 Westport Corrected Report CHHHJC Washington

    The DocLoc field doesn't exit in the database, so I would like to add this field and add the value 'Washington'.

    THanks

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    So add the column through Enterprise Manager and then run an UPDATE statement through Query Analyzer to set the values.

    I don't understand the nature of your problem.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Jul 2004
    Posts
    191
    I don't want to add the value in the database, once I run the query I will save as a .csv file and convert it to excel spreadsheet.

    Thanks

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Do you mean this?

    --------------------------------------------------------------------------------

    select docnum,VERSION, docname, author, 'Washington' AS docloc
    from MHGROUP.DOCMASTER
    WHERE C1alias like 'xxxxx'
    and C2alias LIKE 'xxxx'
    order by docnum
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •