comparing a timestamp with date and time

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
nvuradi
Participant
Posts: 54
Joined: Tue Dec 12, 2006 11:03 pm

comparing a timestamp with date and time

Post by nvuradi »

Hi all,

I have a requirement where in i have to find out records which were inserted after last run. for this i am writing the last run timestamp say LAST_RUN_TS into a file.
the time difference between each run is around 4 hrs..now the database has two fields date CRTE_D and Time CRTE_T...now i have to compare this date and time with the timestamp field from the file..and pass the records which have been inserted after last run..basically i need to find the records with the condition as current TS >= CRTE_TS >= LAST_RUN_TS.

also suggest me whether the approach followed by me is correct or not?
i am getting the timestamp in the file using a join satge.

my question is how to check the above condition as Create timestamp is actually 2 fields date and time?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why not store your timestamp as separate pieces as well? Then you could use something like:

DATE > DATE or (DATE = DATE and TIME > TIME)

Not elegant but would work.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply