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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a longblob?

716


What are the different column comparison operators in mysql?

692


Who developed mysql?

781


What is dblink?

672


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

732


How is myisam table stored?

736


How do I view a mysql database?

674


What is the purpose of using timestamp data type?

702


How does mysql encrypt passwords?

670


What is mysql database extension?

730


What are the different tables present in MySQL?

817


What are the 3 main types of search queries?

644


What do I do if I forgot my mysql root password?

673


how to get only updated, deleted , inserted records after certain interval time in mysql with out using triggers...

2024


What is procedures in mysql?

701