Re: Date Function Usage
Posted in 2000
Topics: General Discussion
Frankie wrote:
>
> Dear all:
> I have a sql syntax problem:
>
> update transtemp set t_exdt= "1999/01/01" where year(t_exdt) < 1999
> || ||
> Date Field How does "String Type"> transform to "Date Type"?
Providing your "String Type" is in the right format, then using the
DATE() function. As in, WHERE YEAR(DATE(t_exdt)) < 1999.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /|
| http://www.informix.com http://www.informixhandbook.com |///// / //|
| http://www.iiug.org +-----------------------------------+//// / ///|
| |This email will self-destruct in |/// / ////|
| |10 sec. If you received this email |// / /////|
| |in error, sorry about the mess. |/ ////////|
+----------------------+-----------------------------------+-----------+
Use the following:
String date format: "mm/dd/yyy"
String datetime year to second format: "yyyy-mm-dd hh:mm:ss"
Bye
In article <8uq06a$df$1@news.xmission.com>,
"Mark D. Stock" <mdstock@mydas.freeserve.co.uk> wrote:
>
> Frankie wrote:
> >
> > Dear all:
> > I have a sql syntax problem:
> >
> > update transtemp set t_exdt= "1999/01/01" where year(t_exdt) <1999
> > || ||
> > Date Field How does "String
Type"
> > transform to "Date Type"?
>
> Providing your "String Type" is in the right format, then using the
> DATE() function. As in, WHERE YEAR(DATE(t_exdt)) < 1999.
>
> Cheers,
> --
> Mark.
>
> +----------------------------------------------------------+----------
-+
> | Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk
|//////// /|
> | http://www.informix.com http://www.informixhandbook.com
|///// / //|
> | http://www.iiug.org +-----------------------------------
+//// / ///|
> | |This email will self-destruct in
|/// / ////|
> | |10 sec. If you received this email
|// / /////|
> | |in error, sorry about the mess.
|/ ////////|
> +----------------------+-----------------------------------+----------
-+
>
Sent via Deja.com http://www.deja.com/
Before you buy.