Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Informix Topics / April 2008

Tip: Looking for answers? Try searching our database.

Informix - how to decrease 30 minutes from current time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
liat.barsela@gmail.com - 22 Apr 2008 09:21 GMT
hello,

I'm trying to decrease 30 minutes from datetime recieved vy paramter,
but I need to correct syntax because none of the following working:
select (2008-04-14 10:00) - 30 units minute or
select "2008-04-14 10:00" - 30 units minute or
select (2008-04-14 10:00) year to minute - 30 units minute

I used to use dateadd function for sybase (select
dateadd(mi,-30,'01/02/2008 10:30'))
and I need help how to run it in informix.
richard.harnden@googlemail.com - 22 Apr 2008 09:29 GMT
On 22 Apr, 09:21, liat.bars...@gmail.com wrote:
> hello,
>
[quoted text clipped - 3 lines]
> select "2008-04-14 10:00" - 30 units minute or
> select (2008-04-14 10:00) year to minute - 30 units minute

Almost, try:

select datetime(2008-04-14 10:00) year to minute - 30 units minute

> I used to use dateadd function for sybase (select
> dateadd(mi,-30,'01/02/2008 10:30'))
> and I need help how to run it in informix.
iiug@perrior.net - 22 Apr 2008 09:49 GMT
On 22 Apr, 09:29, richard.harn...@googlemail.com wrote:
> On 22 Apr, 09:21, liat.bars...@gmail.com wrote:
>
[quoted text clipped - 9 lines]
>
> select datetime(2008-04-14 10:00) year to minute - 30 units minute

There's always the arcane "EXTEND" syntax but why bother when you can
CAST the input value (also, give the resultant expression a name such
as "time_diff"'):

SELECT "2008-04-14 10:00"::DATETIME YEAR TO MINUTE - 30 UNITS MINUTE
time_diff

... and remember to add a FROM clause (because you have to SELECT from
somewhere, even if it's a dummy):
FROM systables WHERE tabid=99
will always work (tabid 99 is the engine version entry)
liat.barsela@gmail.com - 22 Apr 2008 11:13 GMT
On Apr 22, 11:49 am, i...@perrior.net wrote:
> On 22 Apr, 09:29, richard.harn...@googlemail.com wrote:> On 22 Apr, 09:21, liat.bars...@gmail.com wrote:
>
[quoted text clipped - 21 lines]
> FROM systables WHERE tabid=99
> will always work (tabid 99 is the engine version entry)

THANKS A LOT both are working !!!!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.