Results 1 to 3 of 3

Thread: Adding spaces to query output -- really stuck!!

  1. #1
    Ziggy Guest

    Adding spaces to query output -- really stuck!!

    I want to add 3 spaces at the end of each row for the result of a query.

    The initial query being output to a text file (USING DTS) is:

    select colA, colB =
    CONVERT( CHAR(15), TableX.ColB )
    from TableX
    ------------------------------------------------------------------------

    BUT WHEN I EXPORT THE FOLLOWING (USING DTS), I GET THE SAME RESULTS

    select colA, colB =
    CONVERT( CHAR(18), TableX.ColB )+char(32)+char(32)+char(32) -- ' '
    from TableX

    Replacing the char(32) with ' ' (3 spaces in quotes) doesn't help.

    Any ideas of how to append the 3 spaces after each record when exporting to
    a text file using DTS??

    Thanks



  2. #2
    Guest

    Adding spaces to query output -- really stuck!! (reply)


    have you tried double quotes instead of single quotes?

    ------------
    Ziggy at 5/10/01 7:59:54 PM

    I want to add 3 spaces at the end of each row for the result of a query.

    The initial query being output to a text file (USING DTS) is:

    select colA, colB =
    CONVERT( CHAR(15), TableX.ColB )
    from TableX
    ------------------------------------------------------------------------

    BUT WHEN I EXPORT THE FOLLOWING (USING DTS), I GET THE SAME RESULTS

    select colA, colB =
    CONVERT( CHAR(18), TableX.ColB )+char(32)+char(32)+char(32) -- ' '
    from TableX

    Replacing the char(32) with ' ' (3 spaces in quotes) doesn't help.

    Any ideas of how to append the 3 spaces after each record when exporting to
    a text file using DTS??

    Thanks



  3. #3
    Scott Guest

    Adding spaces to query output -- really stuck!! (reply)

    here you go:

    colA, colB =
    convert(char(15), TableX.colB),' ' as colC, ' ' as colD
    from TableX


    ------------
    Ziggy at 5/10/01 7:59:54 PM

    I want to add 3 spaces at the end of each row for the result of a query.

    The initial query being output to a text file (USING DTS) is:

    select colA, colB =
    CONVERT( CHAR(15), TableX.ColB )
    from TableX
    ------------------------------------------------------------------------

    BUT WHEN I EXPORT THE FOLLOWING (USING DTS), I GET THE SAME RESULTS

    select colA, colB =
    CONVERT( CHAR(18), TableX.ColB )+char(32)+char(32)+char(32) -- ' '
    from TableX

    Replacing the char(32) with ' ' (3 spaces in quotes) doesn't help.

    Any ideas of how to append the 3 spaces after each record when exporting to
    a text file using DTS??

    Thanks



Posting Permissions

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