Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > ASP and ASP.NET
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 09-02-2009, 02:43 PM
  #1
moiseszaragoza
Novice (Level 1)
 
Join Date: Sep 2009
Posts: 1
iTrader: (0)
moiseszaragoza is an unknown quantity at this point
asp date() to SQL Server

I am trying to insert into a datefield in the SQL Server
but i get this error



Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][SQL Native Client][SQL Server]Operand type clash: text is incompatible with date

/admin/news.asp, line 96


the value of my date is 9/2/2009
moiseszaragoza is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-08-2009, 09:18 AM
  #2
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,832
iTrader: (0)
afterburn will become famous soon enough
where is the server hosted? if it is not in US then the format wouldn't be like that.
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-11-2009, 02:44 PM
  #3
JosephJames
Fighter (Level 4)
 
Join Date: Aug 2009
Posts: 37
iTrader: (0)
JosephJames is an unknown quantity at this point
I use 'YYYY/MM/DD' format. Please check this article. http://www.eggheadcafe.com/software/...ings-into.aspx
JosephJames is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-14-2009, 09:53 AM
  #4
afterburn
Can't say much here
 
afterburn's Avatar
 
Join Date: May 2004
Posts: 2,832
iTrader: (0)
afterburn will become famous soon enough
Joseph,

The format you are using means the codepage and LCID of the script needs to be a specific format. Otherwise you are inserting text into the database which is 12bytes long vs 4 bytes for smalldatetime. 3 times the size and 12 times longer to search for data on it as a date is stored as a long under the hood in all RDBMs
__________________
ASP.net nice bits
Code Smith rocking tool for Code Generation in any language (Written in .net)
Red Gate SQL tools for DBA
Blog Personal blog
.afterburn
afterburn is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-18-2009, 05:34 AM
  #5
JosephJames
Fighter (Level 4)
 
Join Date: Aug 2009
Posts: 37
iTrader: (0)
JosephJames is an unknown quantity at this point
Ok, So the best bet is to use parameters I think when dealing with strings and dates!
JosephJames is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  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 Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 12:45 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.