Page 1 of 1

Comparing timestamps in a PX job

Posted: Mon Jun 12, 2006 10:51 am
by Rajesh_kr82
I have two timestamps and i want to compare them in a PX job. I think there is no inbuilt routine for this kind of comparison. Has any one implemented this, if yes then can i have the code and the steps to use it?

Rajesh

Posted: Mon Jun 12, 2006 11:02 am
by ArndW
Rajesh,

start at Page B-1 of the Parallel Job Developer's Guide and look at the various date functions. Convert your two dates into numeric values using any one of the methods and you have a method of comparing them.

Posted: Mon Jun 12, 2006 11:38 pm
by kumar_s
And here is one

Code: Select all

SecondsSinceFromTimestamp
Returns the number of seconds between two timestamps in seconds.

Posted: Tue Jun 13, 2006 12:47 am
by ray.wurlod
Is it not possible to compare two timestamps directly? Since they are of the same data type, surely any comparison operator will return a true/false result?

Posted: Mon Sep 10, 2007 5:42 am
by nvuradi
kumar_s wrote:And here is one

Code: Select all

SecondsSinceFromTimestamp
Returns the number of seconds between two timestamps in seconds.
Hi I have used this in My job but this function is returning 0 always. i used a stage variable with Integer 1 to capture the result.

can let me know how to get the proper difference between 2 timestamps?

Thanks
Naren

Posted: Mon Sep 10, 2007 10:45 pm
by dh_Madhu
Well, Recently I prefered handling it in the sql itself to query a database with 1 million records (and growing...) :)

Re: Comparing timestamps in a PX job

Posted: Tue Sep 11, 2007 12:27 am
by JoshGeorge
As noted, you can compare dates or timestamps directly.
Date1=Date2

or

Timestamp1=Timestamp2

If they are different you will get the Status:0
If they are same you will get the Status:1
Rajesh_kr82 wrote:I have two timestamps and i want to compare them in a PX job.