RE: date arithmetic
Posted in 2004
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C3FAFA.D2DD6AC0 Content-Type: text/plain; charset="iso-8859-1" Try using the extend function. It adjusts the precision of a datetime variable or column. EXTEND((value [,first TO last]) Regards, Brian -----Original Message----- From: Alexey Sonkin [mailto:alexeis@grandvirtual.com] Sent: Tuesday, February 24, 2004 11:34 AM To: 'informix-list@iiug.org' Subject: date arithmetic Hi, everybody, I have two fields in a table: (tx_date DATE, tx_time DATETIME HOUR TO SECOND) I need to calculate full DATETIME YEAR TO SECOND value combined from date and time. Is there a way to do that WITHOUT intermediate locale-specific casting to CHAR() - that is, solutions like TO_DATE(tx_date || " " || tx_time, "%m/%d/%Y %T") are not acceptable ------------------------------------------ Alexey Sonkin sending to informix-list ------_=_NextPart_001_01C3FAFA.D2DD6AC0 Content-Type: text/html; charset="iso-8859-1" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45"> <TITLE>RE: date arithmetic</TITLE> </HEAD> <BODY> <P><FONT SIZE=2>Try using the extend function. It adjusts the precision of a datetime variable or </FONT> <BR><FONT SIZE=2>column. </FONT> </P> <P><FONT SIZE=2>EXTEND((value [,first TO last])</FONT> </P> <P><FONT SIZE=2>Regards,</FONT> </P> <P><FONT SIZE=2>Brian</FONT> </P> <P><FONT SIZE=2>-----Original Message-----</FONT> <BR><FONT SIZE=2>From: Alexey Sonkin [<A HREF="mailto:alexeis@grandvirtual.com">mailto:alexeis@grandvirtual.com</A>]</FONT> <BR><FONT SIZE=2>Sent: Tuesday, February 24, 2004 11:34 AM</FONT> <BR><FONT SIZE=2>To: 'informix-list@iiug.org'</FONT> <BR><FONT SIZE=2>Subject: date arithmetic</FONT> </P> <BR> <P><FONT SIZE=2>Hi, everybody,</FONT> </P> <P><FONT SIZE=2>I have two fields in a table:</FONT> <BR><FONT SIZE=2>(tx_date DATE, tx_time DATETIME HOUR TO SECOND)</FONT> </P> <P><FONT SIZE=2>I need to calculate full DATETIME YEAR TO SECOND value</FONT> <BR><FONT SIZE=2>combined from date and time.</FONT> </P> <P><FONT SIZE=2>Is there a way to do that WITHOUT intermediate locale-specific</FONT> <BR><FONT SIZE=2>casting to CHAR() - that is, solutions like </FONT> <BR><FONT SIZE=2>TO_DATE(tx_date || " " || tx_time, "%m/%d/%Y %T")</FONT> <BR><FONT SIZE=2>are not acceptable</FONT> </P> <P><FONT SIZE=2>------------------------------------------</FONT> <BR><FONT SIZE=2>Alexey Sonkin</FONT> </P> <P><FONT SIZE=2>sending to informix-list</FONT> </P> </BODY> </HTML> ------_=_NextPart_001_01C3FAFA.D2DD6AC0-- sending to informix-list