when i declare date data type in sql ,i inserted the date
22-10-2012,but my result is in different date 1894-07-11 any
one pls help me what's wrong in my query
Create table orders(od_id int,od_name varchar(10),od_date
date)
insert into orders values(1,'sai',22-10-2012) and any one
pls suggest what i can learn for 3 years real time
experenice in sql because i am looking for database field



when i declare date data type in sql ,i inserted the date 22-10-2012,but my result is in different..

Answer / lakshmi

The default date format in sql is 'yyyy-mm-dd' but in the query that is in dd-mm-yyyy and without single quotes. Below is the insert query.

insert into orders values(1,'sai','2012-10-22');

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More MySQL Interview Questions

What are the difference between and myisam and innodb?

0 Answers  


In how many ways we can retrieve data in the result set of mysql using php?

0 Answers  


How to convert character strings to numeric values?

0 Answers  


Can we rename database in mysql?

0 Answers  


Why to use char instead of varchar in the database?

0 Answers  






How to get a list of indexes of an existing table?

0 Answers  


What are the ways in which you can retrieve data in the result set of mysql using php?

0 Answers  


How do I find users in mysql?

0 Answers  


Can mysql function return a table?

0 Answers  


What is the maximum length of a table name, database name, and fieldname in MySQL?

3 Answers   Accenture, Pioneer, TISL,


Where MyISAM table will be stored and also give their formats of storage?

0 Answers  


What is mysql_query?

0 Answers  


Categories