Link to home
Start Free TrialLog in
Avatar of Andrew
AndrewFlag for United States of America

asked on

query results to a .txt file ?

How can I write query results to a .txt file WITHOUT quotes wrapping around them?

CODE:

rs.Open "SELECT left(ssn,6) & space(6-len(left(ssn,6))) & space(44) & 'E' & space(11) & format(Hours,'00000.00') & space(12) & format(commission,'000000.00') & space(38) as PayChex FROM Payroll"
       
    Open "C:\Program Files\Helios11\BonusCommish.txt" For Append As #1
               
                    Do Until rs.EOF = True
                   
                    If rs("Paychex") <> "" Then
                                               
                        thePayChex = rs("Paychex")
                       
                                Write #1, _
                                thePayChex
                                rs.MoveNext
                               
                        Else
                        rs.MoveNext
                      End If
               Loop
           
            Close #1
           
            rs.Close

OUTPUT:

"2115                                              E           00079.95            000165.27                                      "
"2090                                              E           00026.49            000089.24                                      "
"2170                                              E           00055.41            000150.58                                      "
"2202                                              E           00031.04            000129.07                                      "
"2213                                              E           00024.44            000000.74                                      "
"1027                                              E           00076.51            000186.53                                      "

TIA,
Andrew
ASKER CERTIFIED SOLUTION
Avatar of PaulHews
PaulHews
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial