You can also remove the hyphens and get a more reliable conversion:
SqlString = "INSERT INTO " &_
" DatesTable " &_
" (StartDate) " &_
"VALUES " &_
" ( convert(datetime,'20090722
Finally, convert to the same data type as the destination - Smalldatetime:
SqlString = "INSERT INTO " &_
" DatesTable " &_
" (StartDate) " &_
"VALUES " &_
" ( convert(smalldatetime, '2009-07-22', 120) )"
or
SqlString = "INSERT INTO " &_
" DatesTable " &_
" (StartDate) " &_
"VALUES " &_
" ( convert(smalldatetime,'200
Main Topics
Browse All Topics





by: angelIIIPosted on 2009-07-22 at 12:22:16ID: 24918641
specify the "style" parameter:
Select allOpen in new window