Re: Date to Time conversion
Posted in 1998
Anil Khanna wrote:
>
> HI,
> Is there any built-in function available in informix to convert
> CHAR into a DATE?
> I have columns start_trx_time and end_trx_time in a table which are
> defined as chars, but ,I want to get the differencesof the two time for
> some purpose.
> Can anyone help me ?
>
> Thanks in advance
Yes. Do this:
ALTER TABLE mytable
MODIFY (
start_trx_time DATE,
end_trx_time DATE
);
That way your database design will be correct.
A possible workaround to your incorrect design might be (not tested):
SELECT ... (today + end_trx_time - start_trx_time - today)
Try it and see.
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
---
If all else fails, read the instructions and the release notes.
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/
---