Re: FN-FORUM SQL Server INSERT (easy question)
date posted 10th July 2001 11:36
Hi Carl
Thanks for that, the real problem I'm having is with the time though
I've converted the the dates as you suggested, but it's now giving me an
error with the time. I've attached the SQL, the ASP and the error message
at the end of this.
Norman
SQL
INSERT INTO motivaction ( motiveTitle, motiveForename, motiveSurname,
motiveOrganisation, motiveAddress, motivePostcode, motiveTelephone,
motiveEmail, motiveContactMethod, motiveDate, motiveStart, motiveFinish,
motiveVenue, motiveGuests, motivePackageID, motiveDateBooked)
VALUES ('Miss', 'Belinda', 'Beresford', 'Private Individual', '105 Houblon
RoadRichmondSurrey', 'TW10 6DB', '020 8241 2222,
[EMAIL REMOVED] 'Email', 'Tuesday, September 10, 2002', '21:00',
'23:30', 'Back garden', 68, 11, 'Tuesday, July 10, 2001');
ASP
thisSQL = _
"INSERT INTO motivaction ( motiveTitle, motiveForename, motiveSurname,
motiveOrganisation, motiveAddress, motivePostcode, motiveTelephone,
motiveEmail, motiveContactMethod, motiveDate, motiveStart, motiveFinish,
motiveVenue, motiveGuests, motivePackageID, motiveDateBooked)" & _
" VALUES ('" & bookingTitle & "', '" & bookingForename & "', '" &
bookingSurname & "', '" & bookingOrg & "', '" & bookingAddress & "', '" &
bookingPostCode & "', '" & bookingTelephone & "', '" & bookingEmail & "', '"
& bookingContactMethod & "', '" & formatdatetime(bookingDate,vbLongDate) &
"', '" & formatdatetime(bookingTimeStart,VBShortTime) & "', '" &
formatdatetime(bookingTimeFinish,VBShortTime) & "', '" & bookingVenue & "',
" & bookingNumbers & ", " & packageID & ", '" &
formatdatetime(bookingDateBooked,vbLongDate) & "');"
Error message
Server: Msg 295, Level 16, State 3, Line 1
Syntax error converting character string to smalldatetime data type.