
February 13th, 2004, 06:15 AM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Error inserting date - The conversion of a char data type to a datetime data type res
Hi,
I'm having huge problems inserting a date into SQL using ASP - I keep getting the following error message:
"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
The SQL is:
INSERT INTO SchemeChanges ([Index], District, Section, SchemeTitle, SchemeDescriptionObjectives, NewCode, ProjectManager, ClientManager, Design, Comments, Position, DateLastChanged, Updated, LastUpdatedBy, Estates, PlanningPermission, Cycling, ITS, TAG, PermanentTROs, TemporaryTROs, LandscapeInvolvement) VALUES (258, 'EBC', '2004/05', 'Central Eastleigh Transport Plan', 'Refurbishment of Eastleigh Bus Station (complete). Preparation of a transport plan for Eastleigh. test', '55965', 'SS', 'JC', '', 'Atkins are preparing a draft strategy for central Eastleigh, to co-ordinate LTP and developer funding. SWHTS Panel agreed consultation process.', 'F', '13/02/2004', '13/02/2004', 'ITCSKN', 'Unknown', 'Unknown', 'Yes', 'Yes', 'Unknown', 'Unknown', 'Unknown', 'Unknown');
The dates come from the following code:
dtDate = FormatDateTime(Now,2)
And I have also tried:
dim curMonth, curDay, curYear, curDate
curMonth = Month(Now)
curYear = Year(now)
curday = day(now)
curDate= curDay & "/" & curMonth & "/" & curYear
dtDate = cdate(FormatDateTime(curDate,2))
But nothing seems to work! I've set the session.lcid = 2057 and have tried putting # around the dates in the query but nothing seems to be working. Any clues at all, anyone?! 
|