Forum Discussion
Ms Access different results from same query on different pc's
- Feb 26, 2020
Gertdj And where are the positioned? It could be decimals normally having a dot, now a comma as the decimal separator. Always convert decimals to text with Str:
TextValue = Str(DecimalValue)
strSql2 = "INSERT INTO tbl_PayRun ( PerId, PayDate, HoursWorked, KmTravelled, HourlyRate, TravelRatePerKm, TotalWorked, TotalKmTravelled, TravelCostAmount, TotalEarnings, TaxRate, Tax, UIFEmployee, UIFEmployer, TotalDeductions, NettPay )" & vbCrLf & _
"SELECT Q_Earnings_Captured.PerId," & vbCrLf & _
strPayDate & "," & vbCrLf & _
"Q_Earnings_Captured.HoursWorked," & vbCrLf & _
"Q_Earnings_Captured.KmTravelled," & vbCrLf & _
"Q_Earnings_Captured.HourlyRate," & vbCrLf & _
"Q_Earnings_Captured.TravelRatePerKm," & vbCrLf & _
"Q_Earnings_Captured.TotalWorked," & vbCrLf & _
"Q_Earnings_Captured.TotalKmTravelled," & vbCrLf & _
"Q_Earnings_Captured.TotalTRavelCost," & vbCrLf & _
"Q_Earnings_Captured.TotalEarnings," & vbCrLf & _
"tbl_Rates.TaxRate," & vbCrLf & _
"[TotalEarnings]*[TaxRate] AS PAYE" & "," & vbCrLf & _
UIF_Actual & " AS UIF_EE," & vbCrLf & _
UIF_Actual & " AS UIF_ER," & vbCrLf & _
"[PAYE]+[UIF_EE] AS TotalDeductions," & vbCrLf & _
"[TotalEarnings]-[TotalDeductions] AS NettPay" & vbCrLf & _
"FROM Q_Earnings_Captured INNER JOIN tbl_Rates ON Q_Earnings_Captured.PerId = tbl_Rates.PerId" & vbCrLf & _
"Where Q_Earnings_Captured.PerId = " & rs1!PerId
Gertdj It could be strPayDate. It should be formatted like:
strPayDate = "#" & Format(PayDate, "yyyy\/mm\/dd") & "#"
- GertdjFeb 26, 2020Copper Contributor
Gustav_Brock Thank you - I will try that, but want to state again that the code works perfectly on two pc's and is only producing extra output fields on the third...
- Gustav_BrockFeb 26, 2020Iron Contributor
Gertdj And which are those additional fields?
- GertdjFeb 26, 2020Copper Contributor
Gustav_Brock - Expr1 and Expr2 - both with a value of 48 that is not anywhere in my dataset