View previous topic :: View next topic
|
Author |
Message |
chitra_chaturvedi
New User
Joined: 24 Jul 2007 Posts: 18 Location: india
|
|
|
|
Hi,
I am fetching a date from the table in USA format like
SELECT CHAR(CURRENT_DATE,USA)
FROM SYSIBM.SYSDUMMY1
In further processing I need to compare above fetched date with some other DB2 date. Since the above date is fetched as character, comparison is not good.
Any suggestions????
Thnx |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the only answers that this kind of question deserves belong to the category...
technically correct, but useless
one example of such an answer would be
make sure that the dates You want to process/compare are all in the same format!
or
when fetching dates convert them to a common format
or ...
it would be good for You to read and meditate on
How To Ask Questions The Smart Way
catb.org/~esr/faqs/smart-questions.html
if You search the forums on the ways of fetching dates in different formats
or converting dates between different formats You will get lots of hits!
but... do You have a doctors prescription to fetch it in char format...
fetch it in a format consistent with the other date formats in Your program! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
to add on to Enrico's comment,
instead of
Code: |
SELECT CHAR(CURRENT_DATE,USA)
FROM SYSIBM.SYSDUMMY1
|
Code: |
SELECT CHAR(CURRENT_DATE,USA)
, CHAR(CURRENT_DATE,otherformat)
, CURRENT_DATE
FROM SYSIBM.SYSDUMMY1
|
|
|
Back to top |
|
|
|