Hi Good People
How Is Code Written for updating A SQL Database, Where the Date is between a Date From to a Date To AND where a ID column is used.
The code I have at the moment. Does not work, After " WHERE "
Code Below
Private Sub UpdatePayment()
SQL.AddParam("@DriverID", LbDriverID.Text)
SQL.AddParam("@DateFrom", LbDateFrom.Text)
SQL.AddParam("@DateTo", LbDateTo.Text)
SQL.AddParam("@DatePaid", LbDatePaid.Text)
SQL.AddParam("@GrossPay", LbGrossPay.Text)
SQL.AddParam("@TaxableIncome", LbTaxableIncome.Text)
SQL.AddParam("@TaxDeductions", LbTaxDeductions.Text)
SQL.AddParam("@N_I_Deductions", LbN_I_Deductions.Text)
SQL.AddParam("@NetPay", LbNetPay.Text)
SQL.AddParam("@UpdatedBy", LbUpdatedBy.Text)
SQL.AddParam("@DateUpdated", LbDateUpdated.Text)
SQL.ExecQuery("UPDATE DailyRecords " &
"SET DatePaid=@DatePaid, " &
"GrossPay=@GrossPay, " &
"TaxableIncome=@TaxableIncome, " &
"TaxDeductions=@TaxDeductions, " &
"N_I_Deductions=@N_I_Deductions, " &
"NetPay=@NetPay, " &
"UpdatedBy=@UpdatedBy, " &
"DateUpdated=@DateUpdated " &
"WHERE DriverID=@DriverID And DateFrom=@DateFrom Between DateTo=@DateTo")
End Sub
Can anyone help with the Code after Where. I need to use the DriverID column then Dates Between.
Kind Regards
Gary