SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 13th, 2004, 06:15 AM
kneame kneame is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 6 kneame User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question 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?!

Reply With Quote
  #2  
Old February 13th, 2004, 06:31 AM
kneame kneame is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 6 kneame User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Don't worry - I've solved this by entering the date as 20040213 which seems to have worked fine!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Error inserting date - The conversion of a char data type to a datetime data type res


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT