|
in advance, where ever that is.
|
|
|
|
|
You might want to check the SQL INSERT query syntax.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
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 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)
|
|
|
|
|
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.
|
|
|
|
|
mjawadkhatri wrote: please tell me ERROR
Actually you should tell us about that. what's the error message?
FYI Oracle to_date usage[^]
|
|
|
|
|
i am Using SQL 2005
Msg 195, Level 15, State 10, Line 1
'TO_DATE' is not a recognized built-in function name.
|
|
|
|
|
Don't worry, you mixed days and months. There is no 23. month since I know.
TO_DATE('12/23/2010', 'mm/dd/yyyy') or TO_DATE('23/12/2010', 'dd/mm/yyyy')
try it manually before using it: select TO_DATE('12/23/2010', 'mm/dd/yyyy') from dual;
Regards
Ralf
|
|
|
|
|
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.
|
|
|
|
|
AND d) the parameters to to_date are consistent.
TO_DATE('12/23/2010','dd/mm/yyyy') is no good.
|
|
|
|
|
AND e) He's not using Oracle.
|
|
|
|
|
|
Maybe because of semicolon you have missed.
For your info : Oracle TO_DATE
modified 24-Apr-20 22:18pm.
|
|
|
|
|
i want to join two tables(Firms and People) to show them in datagridview with ascending order in my program side but the thing is that they dont have any common point.so can i join them ?
vemedya.com
|
|
|
|
|
Sure you can, for instance :
select firms.nmbr as nmbr, firms.name as name, "firm" as type from firms
UNION
select people.id as nmbr, people.surname as name, "people" as type from people;
The UNION keyword joins the two result sets.
Cheers
I don't like my signature at all
|
|
|
|
|
yeah it worked..thanks Estys..one more question it showed the datas as ordered already actually i wished that so it works always like that or i am lucky
vemedya.com
|
|
|
|
|
Without seeing your query, I think that's just blind chance .
Cheers
I don't like my signature at all
|
|
|
|
|
my query is here
select firma_adi[Kişi/Firma],telefon1[Telefon No],telefon2[Telefon No],Telefon3[Telefon No],Telefon4[Telefon No],Telefon5[Telefon No] from Firmalar
Union
select kisi[Kişi/Firma],numara1[Telefon No],numara2[Telefon No],numara3[Telefon No],Numara4[Telefon No],Numara5[Telefon No] from Rehber
vemedya.com
|
|
|
|
|
You can order the data with the ORDER BY clause.
If all select statements use the same fieldnames you can use "ORDER BY <fieldname>",
otherwise you can use the form "ORDER BY 2" where the "2" is the position of the field.
Cheers
I don't like my signature at all
|
|
|
|
|
yeah it works with order too..thanks for your time
vemedya.com
|
|
|
|
|
Where are Stored Procedure stores in MySQL or any other database e.g. SQL Server etc .....
Further explanation of my question,
Such that if i created a database then i know all my data is in this created database ..... but if i talk about creating/using stored procedures then were are they stored.
I.ve searched some example and tutorials for stored procedure ... but i didn't found aobut it.
THANKS
|
|
|
|
|
khurram_shahzad wrote: Such that if i created a database then i know all my data is in this created database ..... but if i talk about creating/using stored procedures then were are they stored
They are stored in hidden table of same database.
You could access it using following.
select * from sys.sql_modules where object_id=object_id('Name_of_your_sp')
|
|
|
|
|
Hi
I would like to know how to create a view in Access???
In SqlServer there is a folder "Views" where u can create views in a very simple way.
Searching with google i found that in access are used sql queries instead of views, but didn't understand well.
Thanks bye
"For as long as men massacre animals, they will kill each other. Indeed, he who sows the seed of murder and pain cannot reap joy and love." Pythagoras
modified on Thursday, December 23, 2010 8:19 AM
|
|
|
|