472,334 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,334 software developers and data experts.

Insert query crash(sql server), Date time format, server is not accepting

H

when i execute this query, my query is crashing throwing an exception "cant convert char datatype to datetime type format

my query is "insert into mytable(mydate) values ('"+ varmydate+ "')

iam passing date format as dd/mm/yyyy
my system date is in format dd/mm/yyyy

is there any problem with sql server inaccepting the above format, or is there any way(universal) to send the datetime format to sql server

is there any system time conflict with sql server date time format

-------need help
-----seas

Nov 15 '05 #1
1 10583
If "varmydate" is really a string and doesn't represent an invalid date
(eg. '2/31/04')
this should be working for you.
Peter
"seash" <an*******@discussions.microsoft.com> wrote in message
news:08**********************************@microsof t.com...
Hi

when i execute this query, my query is crashing throwing an exception
"cant convert char datatype to datetime type format'

my query is "insert into mytable(mydate) values ('"+ varmydate+ "')"

iam passing date format as dd/mm/yyyy
my system date is in format dd/mm/yyyy

is there any problem with sql server inaccepting the above format, or is
there any way(universal) to send the datetime format to sql server?

is there any system time conflict with sql server date time format?

-------need help!
-----seash

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Ricardo | last post by:
How can I make a insert sql string to insert direct in a table(not a dataset) using the textbox.text propert??
7
by: Arek | last post by:
Hey, I am inserting values in the table: Dim sqlcomm1 As SqlCommand = New SqlCommand("INSERT INTO tblTasks (idTask, outdate) VALUES ('" &...
6
by: scott | last post by:
what is the best way to send data to and query SQL 2005 server express edition db hosted on a dedicated server with ISP ? i need to query it...
0
by: getkapilcs | last post by:
Hi, i want to query sql server using xml, where the required fields are to be specified in the xml dynamically. can you tell me how to generate...
1
by: sandeep.damodar | last post by:
Hello, I need help.. I am just trying to insert data from the datagrid to data source, using insert sql statement.
1
by: yzlin04 | last post by:
Does anyone know how to insert date into vb.net datagrid by using INSERT INTO command? From the code below, the error message is in...
0
by: raoofahmedkhan | last post by:
Hi All, I am trying to develop an application in vb.net in which i need to insert date in oracle database, my application is in vb.net. i am...
9
by: Access | last post by:
In my user interface if a user doesn't have access to a field in the database I lock it and make the background color yellow. Problem is I'm...
4
by: awigren | last post by:
I am making a database right now in MS Access. The reason is because we are trying to get away from the Excel file that we originally stored the data...
19
by: phill86 | last post by:
Hi I am re-posting this thread because it has become very confusing and I have got some way to solving the problem so it is a slightly different...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.