Link to home
Start Free TrialLog in
Avatar of kdeutsch
kdeutschFlag for United States of America

asked on

SQl not inserting date into database

I keep getting the error
Line 1: Incorrect syntax near '6/18/2008'.

It started when I put in the date field.  I just want todays date inserted into the database in the dtpayPaid column but what ever way I change I get different errors, what is the correct syntax.  In my sql 2000 database I have it as a datetime field.

sql = "INSERT tblSADPay (intUicId, strSSN, strVendorNum, strBatchNum, strPGYrs, strRank, strNumDays, strPayPeriod, strbasePay,  strDiffPay, strhousing, strrations, strTotalentitlement, strFTWH, strTTWH, strMiles, strMilesPay, strTotalCheck, dtPayPaid)  VALUES (" & uicID & ", '" & lblSSN.Text & "', '" & txtVendor.Text & "', '" & ddlbatchnum.SelectedValue & "',  '" & lblPayGrYrs.Text & "', '" & lblRank.Text "',  '" & lblDutyDays.Text & "', '" & lblPeriodDuty.Text & "', '" & lblBasePay.Text & "',  '" & lblDiffPay.Text & "', '" & lblHouseAllow.Text & "', '" & lblRations.Text & "', '" & lblTotalEntitlement.Text & "',  '" & lblFTWH.Text & "', '" & lblTotalWH.Text & "', '" & lblMiles.Text & "', '" & lblMilesPay.Text & "', '" & lblTotalCheck.Text & "') '" & Date.Today() & "'"
ASKER CERTIFIED SOLUTION
Avatar of brad2575
brad2575
Flag of United States of America 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
Avatar of kdeutsch

ASKER

Ah I see what I did, I forgot to put in the end bracket after the date field.  The one before it needs to come out though.