Page 1 of 1

date feild compare

Posted: Thu Jul 02, 2009 8:03 am
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

Posted: Thu Jul 02, 2009 8:12 am
by chulett
Convert the date to a string in the same format, then you can compare. Or convert your string to a date first.

Re: date feild compare

Posted: Thu Jul 02, 2009 8:14 am
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:

Posted: Thu Jul 02, 2009 8:20 am
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'

Posted: Thu Jul 02, 2009 8:30 am
by chulett
My assumption was "it is ok" should really have been "is it ok?".