Hi
I have a query, the code is:
query Name = SagePaymentHours
I have used Chr(13) & Chr(10) and am wanting to open an excel.csv file.
The code below is to place the results in a csv File when clicking on a command button
I have also used transferText, would like it if this works, but the result appears different
e.g.
However the reults are coming out in the format
64 1 25 (Empty Column) 64 2 3.5 (EmptyCol) 64 3 0
81 1 24.5 81 2 0 81 3 3
I would like the results to be:
64 1 25
64 2 3.5
64 3 0
81 1 24.5
etc
Plz can some1 help
Thx
D
I have a query, the code is:
query Name = SagePaymentHours
I have used Chr(13) & Chr(10) and am wanting to open an excel.csv file.
Code:
SELECT tblEmployee.EmpNo, 1 AS Pay1, Sum(tblPayInv.BasicEmpHours) AS SumOfBasicEmpHours, Chr(13) & Chr(10), tblEmployee.EmpNo, 2 AS Pay2, Sum(tblPayInv.OT1EmpHours) AS SumOfOT1EmpHours, Chr(13) & Chr(10), tblEmployee.EmpNo, 3 AS Pay3, Sum(tblPayInv.OT2EmpHours) AS SumOfOT2EmpHours, Chr(13) & Chr(10), tblEmployee.EmpNo, 7 AS Pay7, Sum(tblPayInv.HolHr) AS SumOfHolHr
FROM tblEmployee INNER JOIN tblPayInv ON tblEmployee.EmpRegNo=tblPayInv.EmpRegNo
GROUP BY tblEmployee.EmpNo, 1, tblEmployee.EmpNo, 2, tblEmployee.EmpNo, 3, tblEmployee.EmpNo, 7, tblPayInv.EmpRegNo, tblPayInv.WEdate
HAVING (((tblEmployee.EmpNo)>63) AND ((tblPayInv.WEdate)=[W/end Date = d/m]))
ORDER BY tblEmployee.EmpNo;
The code below is to place the results in a csv File when clicking on a command button
I have also used transferText, would like it if this works, but the result appears different
e.g.
Code:
Private Sub cmdOutputTo_Click()
DoCmd.OutputTo acOutputQuery, "SagePaymentHours", acFormatXLS, "C:\1\test5.xls"
DoCmd.TransferText acExportDelim, , "SagePaymentHours", "C:\1\test5.csv", False
End Sub
However the reults are coming out in the format
64 1 25 (Empty Column) 64 2 3.5 (EmptyCol) 64 3 0
81 1 24.5 81 2 0 81 3 3
I would like the results to be:
64 1 25
64 2 3.5
64 3 0
81 1 24.5
etc
Plz can some1 help
Thx
D