Hi,
I have an Access form that saves some simple data to a SQL Server table. Everything except the date field data is saved. I get the following:
1900-01-01 00:00:00.000 in the SQL date field.
Here is my code;
Dim dteEntry As Date
dteEntry = Date
sql = "Insert Into tblFranchiseDiary (Franchise,EntryType,Staff,EntryDate) Values ('" & cmbFranchise & "','" & cmbType & "','" & cmbUser & "', " & dteEntry & " )"
Debug.Print sql
Set rs = cn.Execute(sql)
debug output is as follows;
Insert Into tblFranchiseDiary (Franchise,EntryType,Staff,EntryDate) Values ('Arkham','Ticket','Joe Bloggs', 17/10/2012 )
What am I doing wrong?
thanks
Ian
I have an Access form that saves some simple data to a SQL Server table. Everything except the date field data is saved. I get the following:
1900-01-01 00:00:00.000 in the SQL date field.
Here is my code;
Dim dteEntry As Date
dteEntry = Date
sql = "Insert Into tblFranchiseDiary (Franchise,EntryType,Staff,EntryDate) Values ('" & cmbFranchise & "','" & cmbType & "','" & cmbUser & "', " & dteEntry & " )"
Debug.Print sql
Set rs = cn.Execute(sql)
debug output is as follows;
Insert Into tblFranchiseDiary (Franchise,EntryType,Staff,EntryDate) Values ('Arkham','Ticket','Joe Bloggs', 17/10/2012 )
What am I doing wrong?
thanks
Ian