INSERT QUERY NOT WORKING
-
mjawadkhatri wrote:
please tell me ERROR
Actually you should tell us about that. what's the error message? FYI Oracle to_date usage[^]
thatraja |Chennai|India|
Brainbench certifications
My Dad had a Heart Attack on this day so don't...i am Using SQL 2005 Msg 195, Level 15, State 10, Line 1 'TO_DATE' is not a recognized built-in function name.
-
What error are you getting? What's the underlying data type in this field? What's the table definition (your query only stands a chance of working if there's only a date field in the table test)?
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
i am Using SQL Msg 195, Level 15, State 10, Line 1 'TO_DATE' is not a recognized built-in function name.
-
please help.... this query is not working.. please tell me ERROR INSERT INTO test Values(TO_DATE('12/23/2010','dd/mm/yyyy')) Thnaks In Advance
Your query is allright IF a) You have only one column in table to insert b) You have function called TO_DATE created to give you supposed output compatible with column you have c) Your function taking two parameters as a INPUT.
mjawadkhatri wrote:
this query is not working.. please tell me ERROR
Only SQL can give neither any of us, Sorry for that.
Regards, Hiren.
My Recent Article: - Way to know which control have raised a postback
My Recent Tip/Trick: - The ?? Operator. -
Your query is allright IF a) You have only one column in table to insert b) You have function called TO_DATE created to give you supposed output compatible with column you have c) Your function taking two parameters as a INPUT.
mjawadkhatri wrote:
this query is not working.. please tell me ERROR
Only SQL can give neither any of us, Sorry for that.
Regards, Hiren.
My Recent Article: - Way to know which control have raised a postback
My Recent Tip/Trick: - The ?? Operator.AND d) the parameters to to_date are consistent. TO_DATE('12/23/2010','dd/mm/yyyy') is no good. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Season's Greetings to all CPians.
-
i am Using SQL Msg 195, Level 15, State 10, Line 1 'TO_DATE' is not a recognized built-in function name.
Are you using SQL Server? TO_DATE is Oracle syntax. The equivalent in SQL Server is
CONVERT(datetime, '12/23/2010', 101)
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
AND d) the parameters to to_date are consistent. TO_DATE('12/23/2010','dd/mm/yyyy') is no good. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Season's Greetings to all CPians.
AND e) He's not using Oracle. :rolleyes:
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
Are you using SQL Server? TO_DATE is Oracle syntax. The equivalent in SQL Server is
CONVERT(datetime, '12/23/2010', 101)
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
Yes I am Using SQL Server 2005 and i need to insert date in dd/mm/yyyy format how it possible please help me
-
Yes I am Using SQL Server 2005 and i need to insert date in dd/mm/yyyy format how it possible please help me
A few thoughts.
- Is this field actually a datetime?
- Is it a datetime in your application?
- What does the format of the date matter?
If the field is a datetime, and it's being passed in as a datetime then you don't need to do anything. Just insert it as it is - the only reason you'd convert it is if you were passing it in as a string, and you should really avoid this and pass it in as a datetime instead. The format of the date is immaterial - just store it in the universal date format; choosing the format is only relevant when you display the date to the user and you should use the users locale to do this.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
please help.... this query is not working.. please tell me ERROR INSERT INTO test Values(TO_DATE('12/23/2010','dd/mm/yyyy')) Thnaks In Advance
The bad thing is that the "S" in "SQL" means "structured", not "standard". Look at the "SQL Zoo" for the SQL code in many databases, e.g. http://sqlzoo.net/howto/source/u.cgi/tip218780[^]
-
please help.... this query is not working.. please tell me ERROR INSERT INTO test Values(TO_DATE('12/23/2010','dd/mm/yyyy')) Thnaks In Advance
Maybe because of semicolon you have missed. For your info : Oracle TO_DATE