date feild compare

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
consulting
Participant
Posts: 50
Joined: Fri Dec 21, 2007 3:24 am

date feild compare

Post by consulting »

hi

I am having date feild named DATE_PURCH
My requirement is DATE_PURCH<>'1900-01-01'
it is ok
and also i have to handel null for it
balaji
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Convert the date to a string in the same format, then you can compare. Or convert your string to a date first.
-craig

"You can never have too many knives" -- Logan Nine Fingers
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Re: date feild compare

Post by priyadarshikunal »

consulting wrote:hi

I am having date feild named DATE_PURCH
My requirement is DATE_PURCH<>'1900-01-01'
it is ok
and also i have to handel null for it

I think you are making a statement. Sometimes its better to ask questions when you want someone to answer it. :wink:
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Op says
My requirement is DATE_PURCH<>'1900-01-01'
it is ok
Is the question
i have to handel null for it
If yes, assuming source is char at this point, it will be

NullToValue(DATE_PURCH, '1900-01-01') <> '1900-01-01'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

My assumption was "it is ok" should really have been "is it ok?".
-craig

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