Labels

Flash (1)

Friday, December 10, 2004

Insert Into SQL Statment using Dates

When using dates or times, they need to be in the correct format to add them to your database. Make sure they are valid dates, then surround them with # signs.

Example:


strSQL = "INSERT INTO Events([Date], EventName, Location, [Time]) VALUES (#" & CDate(txtDate.Text) & "#, '" & txtEventName.Text & "', '" & txtLocation.Text & "', #" & CDate(txtTime.Text) & "#)"