TimeStamp To Date Conversion

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
QuestExpert
Participant
Posts: 22
Joined: Tue Mar 13, 2007 10:10 am

TimeStamp To Date Conversion

Post by QuestExpert »

Hey,
I am geting TimeStamp "2008-06-18 10:34:51"from Oracle Table Field, but I want to compare it with a Date Field "2008-06-18", which does not have Time attached,
How can I convert and compare these two dates,
Quest Expert
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Extract everything before the first space from your timestamp using the FIELD() function and then compare.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
QuestExpert
Participant
Posts: 22
Joined: Tue Mar 13, 2007 10:10 am

TimStamp to Date

Post by QuestExpert »

Can you provide some more info. please
like what will be the Syntax?
DSguru2B wrote:Extract everything before the first space from your timestamp using the FIELD() function and then compare.
Quest Expert
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Compare the two directly as strings. Use the substring operator [] to hack off the first ten characters of the timestamp when you do:

Code: Select all

If Link.Timestamp[1,10] > Link.Date Then...
Or Field(). :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
vivekgadwal
Premium Member
Premium Member
Posts: 457
Joined: Tue Sep 25, 2007 4:05 pm

Re: TimStamp to Date

Post by vivekgadwal »

QuestExpert wrote:Can you provide some more info. please
like what will be the Syntax?
DSguru2B wrote:Extract everything before the first space from your timestamp using the FIELD() function and then compare.
QuestExpert,

You should be having DataStage installed. Go to HELP and search Field() function. It is pretty straight forward!! You can also use Craig's solution too.
Vivek Gadwal

Experience is what you get when you didn't get what you wanted
Post Reply