f



Finding difference in minutes between 2 DateTimes

I'm a MS SQL guy and brand new to Informix.

I'm trying to find a status time in minutes and I can't seem to figure
it out.

Select (current-u.status_time) as StatusMinutes from users u

This works, but it gives me results as:
0 00:41:38.000
0 00:19:18.000
0 00:19:18.000

I'm just trying to get
41
19
19

Thanks for the help.
0
1/15/2010 1:00:40 AM
comp.databases.informix 16083 articles. 0 followers. Post Follow

2 Replies
4466 Views

Similar Articles

[PageSpeed] 0

Hi J,
Try=20
Select (current-u.status_time)::INTERVAL MINUTE(8) TO
MINUTE::CHAR(9)::INT as StatusMinutes from users u

The Int on the end is to get it to a number (assume you need that)
And the Char(9) is to get you from interval to int - there is no direct
cast
The Char has to be 1 longer than the interval as it takes the end
character as well.
The Minute(8) will allow the result to be 8 digits long (99,999,999
minutes) - trim as necessary.

Jarrod Teale
Fonterra NZ

-----Original Message-----
From: informix-list-bounces@iiug.org
[mailto:informix-list-bounces@iiug.org] On Behalf Of J. Hart
Sent: Friday, 15 January 2010 2:01 p.m.
To: informix-list@iiug.org
Subject: Finding difference in minutes between 2 DateTimes

I'm a MS SQL guy and brand new to Informix.

I'm trying to find a status time in minutes and I can't seem to figure
it out.

Select (current-u.status_time) as StatusMinutes from users u

This works, but it gives me results as:
0 00:41:38.000
0 00:19:18.000
0 00:19:18.000

I'm just trying to get
41
19
19

Thanks for the help.
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list


DISCLAIMER:
This email contains confidential information and may be legally =
privileged. If you are not the intended recipient or have received this =
email in error, please notify the sender immediately and destroy this =
email.
You may not use, disclose or copy this email or its attachments in any =
way.
Any opinions expressed in this email are those of the author and are not =
necessarily those of the Fonterra Co-operative Group.
http://www.fonterra.com/

0
Jarrod
1/15/2010 1:12:35 AM
Thanks Jarrod,

That worked.




On Jan 14, 5:12=A0pm, "Jarrod Teale" <Jarrod.Te...@fonterra.com> wrote:
> Hi J,
> Try
> Select (current-u.status_time)::INTERVAL MINUTE(8) TO
> MINUTE::CHAR(9)::INT as StatusMinutes from users u
>
> The Int on the end is to get it to a number (assume you need that)
> And the Char(9) is to get you from interval to int - there is no direct
> cast
> The Char has to be 1 longer than the interval as it takes the end
> character as well.
> The Minute(8) will allow the result to be 8 digits long (99,999,999
> minutes) - trim as necessary.
>
> Jarrod Teale
> Fonterra NZ
>
>
>
> -----Original Message-----
> From: informix-list-boun...@iiug.org
>
> [mailto:informix-list-boun...@iiug.org] On Behalf Of J. Hart
> Sent: Friday, 15 January 2010 2:01 p.m.
> To: informix-l...@iiug.org
> Subject: Finding difference in minutes between 2 DateTimes
>
> I'm a MS SQL guy and brand new to Informix.
>
> I'm trying to find a status time in minutes and I can't seem to figure
> it out.
>
> Select (current-u.status_time) as StatusMinutes from users u
>
> This works, but it gives me results as:
> 0 00:41:38.000
> 0 00:19:18.000
> 0 00:19:18.000
>
> I'm just trying to get
> 41
> 19
> 19
>
> Thanks for the help.
> _______________________________________________
> Informix-list mailing list
> Informix-l...@iiug.orghttp://www.iiug.org/mailman/listinfo/informix-list
>
> DISCLAIMER:
> This email contains confidential information and may be legally privilege=
d. If you are not the intended recipient or have received this email in err=
or, please notify the sender immediately and destroy this email.
> You may not use, disclose or copy this email or its attachments in any wa=
y.
> Any opinions expressed in this email are those of the author and are not =
necessarily those of the Fonterra Co-operative Group.http://www.fonterra.co=
m/- Hide quoted text -
>
> - Show quoted text -



0
J
1/19/2010 3:29:18 PM
Reply:

Similar Artilces:

Subselect from 2 tables from 2 different databases
Hi Folks, I've been doing some research in this group and on the web but can't seem to find the one clue that I'm looking for. I have an ASP Page and need to join 2 tables from 2 different Access databases. I can explain why 2 databases but it would just make this a longer post so please just trust me. I've gotten the following code to work fine: ----------------------------- <% 'INTERNAL DB CONNECTION dim strWWWRoot, strDBRoot, strDBName strWWWRoot = server.mappath("/") strDBRoot = strWWWRoot & "\..\" strDBName = "wwwroot/devel/customer...

A look at a different databases growing pains may yield insight in to Informix's future. #2
--_da372a14-8eba-4924-9c00-97550d3e741f_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Using Cloudscape as an example... =20 Some of you may know Cloudscape as a 100% Java =2C embedable database. IBM tossed it out under Apache license which meant that anyone could do wha= t they want with it=2C and any company could then pick up the good things a= nd relicense it as they see fit. =20 Sun has picked up JavaDB and now push it out with their distros. Also sell = support. IBM pulled out. =20 What is interesting is that there are a couple of net new features. The do= wnside to these features is that they increase the foot print of the databa= se=2C making it larger and sometimes too big to embed in a web app. =20 Looking forward=2C there has to be a design change such that certain featur= es need to be "pluggable". That is you need to be able to customize the jar= file to have only the features you want=2C outside of the core features yo= u need. This way the same code base could be used to be embedded=2C and als= o to be a more GPRDBMS database written in Java. =20 Taking a look at Informix. This same type of build could have its advantage= s. An example would be support for alternative indexing strategies. XML sup= port=2C ODF/PDF document support=2C HA/ER support=2C and of course better p= arallelization similar to XPS. All of these extra features could be modular= plug ins. Simil...

How to copy a sun-database in one informix database to another informix database?
Hi, Sorry I am not an informix dba, and I was faced to copy a sub-database(sorry I don't know the clear name of such concept, as informix is like sql-server, which used multiple database) from one informix database system to another informix database. I know in oracle, we can use transportable tablespace, copy the datafile and transport the metadata, and do something else. How can I do it in informix then? Is there document which talk about the detail step? Thanks It would really help if you knew the versions of the Informix databases. Assuming Informix IDS 7.x or IDS 9.x If the two systems are binary compatible the fastest method is to use onunload/onload. If the systems are not binary compatible the easiest way is to use dbexport/dbimport. Everything is well documented in the manual "IBM Informix Migration Guide". This manual covers all Informix databases from Standard Engine and Online to IDS and XPS. See http://www.ibm.com/informix/pubs zhu chao wrote: > Hi, > Sorry I am not an informix dba, and I was faced to copy a > sub-database(sorry I don't know the clear name of such concept, as > informix is like sql-server, which used multiple database) from one > informix database system to another informix database. > I know in oracle, we can use transportable tablespace, copy the > datafile and transport the metadata, and do something else. How can I > do it in informix then? Is there...

Where can I find the data structure for versa mail 2.5 database? #2
Hi I need to program for access the database of versa mail database,include attachment. Where can I find the data structure for versa mail 2.5 database? Tao ...

Moving a single instance 9.2.0.7 database to a clustered 9.2.0.6 database environment #2
HI, I have the following situation: We have Veritas cluster setup , and there are 2 solaris servers on which VCS is set up. On this set up we have about 8 databases all of which are 9.2.0.6 version. Now we have one stand alone solaris server, and it has a 9.2.0.7 database. This database is for a third party application -Clear Case & Clear Quest. Now it is required to move the single instance database to clustered environment. Since in the clustered environment we have 9.2.0.6 version, is it AT ALL POSSIBLE to move this database, which is 9.2.0.7 to that enviroment? I guess not, and i...

How to do something every 2 minutes and know which 2 minute interval I have
Consider the following code: package sim; import common.*; public class TrafficLightTester { public static void main(String [] args) { // create 4 lights Light north = new Light(STATE.GO); Light south = new Light(STATE.GO); Light east = new Light(STATE.STOP); Light west = new Light(STATE.STOP); // Create 6 STATE arrays STATE[] s1 = {STATE.GO, STATE.GO, STATE.STOP, STATE.STOP}; STATE[] s2 = {STATE.AMBER, STATE.AMBER, STATE.STOP, STATE.STOP}; STATE[] s3 = {STATE.STOP, STATE.STOP, STATE.LEFT, STATE.LEFT}; STATE[] s4 = {STATE.STOP, STATE.STOP, STATE.GO, STATE.GO}; STATE[] s5 = {STATE.STOP, STATE.STOP, STATE.AMBER, STATE.AMBER}; STATE[] s6 = {STATE.LEFT, STATE.LEFT, STATE.STOP, STATE.STOP}; int count = -1; count++; if (count == 0 ) { north.setLightState(s1[0]); south.setLightState(s1[1]); east.setLightState(s1[2]); west.setLightState(s1[3]); System.out.println("North"); north.showLight(); System.out.println("South"); south.showLight(); System.out.println("East"); east.showLight(); System.out.println("West"); west.showLight(); } if (count == 150000 ) { north.setLightState(s2[0]); south.setLightState(s2[1]); east.setLightState(s2[2]); west.setLightState(s2[3]); System.out.println("North"); north.showLight(); System.out.println("South"); south.showLight(); System.out.println("East"); east.showLight(); System.ou...

Printing to 2 different paper trays or to 2 different printers
I love you all. i cannot print the same report to 2 diferent paper trays using ms access. i cannot print the same report to 2 different printers KB200546 gives a way to di it but it doesn't work with Access Runtime. What can i do ? Try Troy's suggestions in the FMS Community Newsgroup posting at: http://www.fmsinc.com/ubb/Forum12/HTML/000378.html In particular, try the link he provided in his reply dated 10/27/2003 http://www.fmsinc.com/ubb/Forum9/HTML/000103.html Tom PS. We love you too. :) ________________________________ "Xavier" <nadine.oumouk@libertysurf....

What is the difference between (x^2+y^2) and (x.^2+y.^2) in matlab?
z=sqrt(x^2+y^2) c=(z<15) imshow(c) gives a square cut diagonally half with lower right side being white and other being black z=sqrt(x.^2+y.^2) c=(z<15) imshow(c) gives a square with circle in centre What is the difference between (x^2+y^2) and (x.^2+y.^2) in matlab? "Sagar Chand" <sagarchand_9@rediffmail.com> wrote in message <n8efgg$100$1@newscl01ah.mathworks.com>... > z=sqrt(x^2+y^2) > c=(z<15) > imshow(c) > gives a square cut diagonally half with lower right side being white and other being black > > z=sqrt(x.^2...

Moving Informix TableSpaces between databases #2
Hi I am using Informix for one of my DW projects. We are loading data from the source system into the staging area both are separate Databases. Source has logging enables and staging has it disabled. The problem comes when I try to access data across both these databases. I cannot link tables between these databases because of their logging properties. So I am dumping the data into a CSV file and loading it again but for my initial load which consists of 40+ million records it is a problem. In oracle I know we can make a separate table space and dump the data there then load the table space to another database. I don't know if such a thing is possible in Informix. Any help will be appreciated. Thanks and Regards, Aash sending to informix-list ...

Finding Differences in at least 2 Images
I'll really appreciate if someone can help me on this! I have 2 similar images, which are basically the same. The difference will be: one with small particles and another is without. I need to find out the difference, which means I need to find out if the particles exist. I've tried XOR after threshold and etc. But this doesn't seems like a good idea, as when the pictures are taken,the background,lightings,etc may differ;which makes XOR useless in this case. By the way, I'm a beginner in MATLAB, so if someone replies this, please explain further so that I can understa...

Finding and accessing documents in different databases
Hello NG! First I'd like to excuse any bad english, I'm a bit out of practise lately. And as I only have a german version of Notes/Domino, I hope I get all terms right. I am to create an intranet portal for web browsers which is based on Notes R5. The problem is, I'm completely new to Notes/Domino (well, as I'm still trainee in my first year, I'm not much experienced on several other programming languages either). I created a new database "portal.nsf" which contains a frameset an several pages. On one page I used @DbColumn to get a list of names from...

linking between 2 databases (on different servers)
Hi, I use 2 servers containing separate content. The content is accessed using the same username and password. I have the ip remote server address for one of the servers but the second server providers are refusing to hand out the same information because of security concerns. The info I store on this second server does have to be kept safe. Is there a way of creating a link between the databases using php code which does not require the ip address of the second server? I do not want to compromise on security. Thank you for your time. ANF --------------------------------...

Re: how to find difference between two datetime
IN what form do you want the results in interger form, time form, ???? Toby Dunn You never know what is enough, until you know what is more than enough. ~William Blake, Proverbs of Hell When the student is ready, the master appears. ~Buddhist Proverb Only that in you which is me can hear what I'm saying. ~Baba Ram Dass From: Suthakar Iyer <suthakariyer@YAHOO.COM> Reply-To: Suthakar Iyer <suthakariyer@YAHOO.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: how to find difference between two datetime Date: Fri, 3 Nov 2006 18:47:40 -0800 Hi, fdose =09OCT2006:09:03:00 ...

How to find differences in logical Files #2
When I had to change a Physical file I first had to remove all logicals: Then I can compile the physical and after that I can compile the logicals. We work with modelfiles and so I can see the differences between the record or file levelchecknumber of the model and the production database. So I can automaticly rebuild the product database. My problem is that when I change only an existing LF (for instance: change keyflds or select and omit statements) and compile that, the checksum does'nt change. Does somebody knows how -automaticly- I can find out when a logical model file is changed?...

Trouble restoring 7.2.1 database into 7.4.2 database
This is a multi-part message in MIME format. ------=_NextPart_000_0047_01C41DC9.42906D90 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I have table defined as follows: create table vm_emailjob ( JobId serial not null, MessageId varchar(128) not null, Recipients bytea not null, SendTime bigint not null, QueuedTime bigint not null, RetryCount integer ...

RE: Informix database creation #2
Hi The existing chunk is already starting at offset of 500. Your new chunk should have the offset as 600501 . Regards Ravinder Bahadur _________________________________________________________________ Are you Unmarried? http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?4d Register in India's No 1 Matrimony. sending to informix-list "Ravinder Bahadur" <ravinder_b@hotmail.com> wrote in message news:bgsam4$i9q$1@terabinaries.xmission.com... > > Hi > The existing chunk is already starting at offset of 500. Your new chunk > should have the offset as 600501 . Nonsense! ...

Re: 2 Different Database Transactions
That's OK. I got it by doing as follows: begin work; insert into db1@server1:tab1 values ... update db2@server2:tab2 set ... commit work; Cheers, Dorn. ----- Original Message ----- From: "Dorn Bhechsonggram" <dorn@bakcommunications.com> To: "informix-list" <informix-list@iiug.org> Sent: Monday, March 01, 2004 02:04 PM Subject: 2 Different Database Transactions > I just wonder whether anyone can give me some recommendations. > > If I need to execute the query in 2 different databases as follows: > > --1st connection > begin work; > insert into table1 value ('x'); > > --2nd connection > update table2 set column1 = columns2; > commit work; > > I want both transaction to complete and then commit. > My question is whether I can issue just 1 BEGIN WORK/COMMIT WORK for both > connection and it will commit for both queries. > > I am not sure if I explain clearly. Please let me know. > > Thank you. > Dorn. > > > sending to informix-list sending to informix-list Dorn Bhechsonggram wrote: > That's OK. I got it by doing as follows: > > begin work; > insert into db1@server1:tab1 values ... > update db2@server2:tab2 set ... > commit work; Yes that's the best way. You couldn't do it the other way without somehow starting an XA-style transaction, and having both connec...

wxMac 2.6.2
Hi all, I have this odd situation where I'm porting an app from CW8 wx2.6 to Xcode 2.2 wx2.6. With CW8, the root folder for the app was where the actual executable was (Contents/MacOSClassic). For the Xcode 2.2 port, the root folder is the location of the top-level .app folder. I haven't changed any code at all in doing the port. I was wondering if there was something that would cause this to happen since no code has changed. This is important because I would expect the location of the executable to be the root directory and point to the Resources folder as .../Resources. No...

Different databases or different schemas?
Hi, Even if I'm using Oracle since some year, I have some (many?) doubts about the use of differents schema instead of different DBs. Generally to manage a test environment, a development enviroment and a production environment, I create 3 different databases on the same oracle instance (MYDB_TEST, MYDB_PROD, MYDB_DEV). But I was thinking if to create only 1 database and 3 different schemas for test, developing and production on the same database, could be a better solution. Does anybody can suggests me which is the best solution and which are the advantages (and disadvantages) of the two...

Find changes or differences in 2 text files
Is there a simple perlish way (or module) of comparing 2 text files (or 2 strings containing their contents) and determining what is different between the two? These text files are straight text, not data of any type. Something along the lines of Diff without having to shell out to it (unless Difff is faster). Bill H On Wed, 03 Sep 2008 11:09:42 -0700, Bill H wrote: > Is there a simple perlish way (or module) of comparing 2 text files (or > 2 strings containing their contents) and determining what is different > between the two? These text files are straight text, not data of any &...

Find and Replace #2 #2
Participants, Does anyone have the intermittent problem when using the Find and Replace capability. When seeking a word, in a running note book using this function with a replacement, Mathematica ends up "Not Responding" and I need to shut it down and start over. Microsoft 7, 64Bit, HP Z800 16Gigs, Intel Xeon Mathematica 8.04 Thank You, Benedetto Bongiorno CPA CRE Cell 214-707-6546 Land 972-470-9138 Fax 972-470-9748 bongiob@sbcglobal.net This Email is covered by the Electronic Communications Privacy Act, 18 U.S.C. Sectio...

Re: Moving Informix TableSpaces between databases #2
I think your best bet would be to use HPL to unload data from the logged db and load it into the non-logged db as long as they both have the same schema(=table definition). Regards, Uday. "Aashish Ramsinghani - ASDC, Chennai" To <Aashishsr@hcl.in informix-list@iiug.org > cc Sent by: owner-informix-li Subject st@iiug.org Moving Informix TableSpaces between databases 12/09/2005 07:01 AM Hi I am using Informix for one of my DW projects. We are loading data from the source system into the staging area both are separate Databases. Source has logging enables and staging has it disabled. The problem comes when I try to access data across both these databases. I cannot link tables between these databases because of their logging properties. So I am dumping the data into a CSV file and loading it again but for my initial load which consists of 40+ million records it is a problem. In oracle I know we can make a separate table space and dump the data there then load the table space to another database. I don't know if such a thing is possible in Informix. Any help will be appreciated. Th...

database security #2 #2
i a the user of sql server 2005 on window server 2003. i want to know that how can i prevent my database from other user logins because all of them are sysadmin type. and i am also looking for database concurrency control methods. if any one know about this plz mail me answer on this mail id mahendersingh_be@yahoo.co.in thanx in advance On 11 juin, 13:00, Mandy <mahendersing...@gmail.com> wrote: > i a the user of sql server 2005 on window server 2003. i want to know > that how can i prevent my database from other user logins because all > of them are sysadmin type. > an...

2 servidores, 2 databases
Hola, una consulta: El escenario es el siguiente: SERVIDOR A SERVIDOR B databaseA databaseB En el servidor A, database A tengo la mayoria de mis tablas, mientras que en el servidor B, databaseB unicamente tengo tablas de tipo historica, a su ves estas tablas estan como sinonimas en el servidor A, databaseA.... la pregunta es: * Las tablas del servidor B, databaseB desde el servidor A, databaseA podran realizar todas las funciones de Select,Update,Inser,Delete,Alter ... etc, asi como ejecutar SPL. ??? Algun otro comentario al respecto se los agradecere mucho. saludos sending to informix-list ...

Web resources about - Finding difference in minutes between 2 DateTimes - comp.databases.informix

Difference - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

3Q EARNINGS: Mark Zuckerberg on the Differences Between Messenger and WhatsApp
When Facebook announced its intent to acquire cross-platform messaging application WhatsApp in February, questions surfaced on whether WhatsApp ...

Facebook Tips: What’s the Difference between Top News and Most Recent?
The following is part of our series, Facebook Tips, which answers some of the most commonly asked questions about using Facebook. While we hope ...

No evidence Ritalin makes a difference long term for ADHD kids
... to struggle academically and mentally as they get older, regardless of whether they're on medication. Drugs such as Ritalin make no difference ...

The X factor: Who's ready to make a difference for your club?
We take a look at a player from each club who used the NAB Challenge to show they could give their team&nbsp;something different in 2016.

The marginal importance of marginal ideological differences on the Supreme Court
I am not getting the argument that Obama’s choice of a moderate justice is a massive concession even if he can be confirmed before the lame duck ...

What are the differences between AR and VR?
Now that HTC Vive has become available, we seem to have moved past virtual reality that gives you motion sickness and we can really start to ...

Can voters tell the difference between a Trump quote and a Hitler quote?
How can one compare Donald Trump to Adolf Hitler? One is a highly successful businessman turned presidential candidate with absolutely no consistency ...

There IS a difference between the parties!
Today, with her apology (which included a friggin’ history lesson!), Hillary Clinton demonstrated the difference between Hillary Clinton and ...

Byron York: Trump Exposed ‘Enormous Difference’ Between Republican Elitist and Voters on Issues
Byron York: Trump Exposed 'Enormous Difference' Between Republican Elitist and Voters on Issues

Resources last updated: 3/17/2016 6:45:39 PM