updating date fields using sql

updating date fields using sql

am 24.03.2005 15:22:17 von Mark Mchugh

Hi,
Dont know whats happening here

i'm using the following SQL

update policies set renewdate = '21/02/2006' where
polnumber = 'WRIM01002';


but, when i update the databse, the date sets to the
year 2021 ? i've prob done something daft......

please help if you can...

MArk



__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: updating date fields using sql

am 24.03.2005 15:45:51 von Tom Crimmins

On Thursday, March 24, 2005 08:22, Mark Mchugh wrote:

> Hi,
> Dont know whats happening here
>
> i'm using the following SQL
>
> update policies set renewdate = '21/02/2006' where
> polnumber = 'WRIM01002';
>
>
> but, when i update the databse, the date sets to the
> year 2021 ? i've prob done something daft......

The date format should be yyyy-mm-dd. Try:

update policies set renewdate = '2006-02-21' where
polnumber = 'WRIM01002';

http://dev.mysql.com/doc/mysql/en/datetime.html

Slashes will work in place of dashes.

--
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org