RE: FN-FORUM SQL Server INSERT (easy question)
date posted 10th July 2001 12:36
Norman,
Try using a datetime data type for the table column instead.
Cheers,
Pete
_________________________________________
P e t e r E b d o n
Professional Software Engineering Ltd
Microsoft Certified Professional
Email : [EMAIL REMOVED]
Tel/Fax : +44(0)1235-227279
Mobile : +44(0)7973-178945
Web : www.pseltd.com
-----Original Message-----
From: [EMAIL REMOVED]
[EMAIL REMOVED] Behalf Of Norman Beresford
Sent: 10 July 2001 11:38
To: [EMAIL REMOVED]
Subject: Re: FN-FORUM SQL Server INSERT (easy question)
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.
============================================================
* Free listing for freelancers
* Free to advertise jobs
* Free jobs distribution service
* Free database of 1000 freelancers
Freelancers and Freelance Jobs
http://www.freelancers.net
To post to the Forum:
[EMAIL REMOVED]
To unsubscribe please email:
[EMAIL REMOVED]
If you have difficulties unsubscribing please email:
[EMAIL REMOVED]
To subscribe to the digest for this list or for further information please
visit:
http://www.freelancers.net/forum.html