Best way I've found that doesn't take a bizzilion lines is with timestamp.
It is very friendly.

In your case I think it would be:

DATE( TIMESTAMP( DIGITS( FIELD * 10000 ) || '00' ) )

You may need to play with it a bit to get it, but timestamp will convert
"CCYYMMDDhhmmss".

If you know you just want the date, then try:

DATE( TIMESTAMP( DIGITS( FLOOR( FIELD ) || '000000' ) )

Mark

message: 1
date: Fri, 19 Oct 2007 13:25:07 -0400
from: "Brian Piotrowski" <bpiotrowski@xxxxxxxxxxxxxxx>
subject: Converting Integer to Dates

Hi All,

Is there an easy way in the SQL interpreter to convert an integer to a
date? The original programmers thought it was cool to dump all
date/time fields into int 8/4 which sucks when you're trying to do
calculations on them (they also like to use a 25h clock, but that's a
whole other can of worms).

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].