|
SQL can handle character dates in the ISO, USA or EUR format very well, but
not very well with numeric dates.
But there was an enhancement in Release 7.2 in the scalar functions such as
DEC, INTEGER, so a Date, Time or Timestamp can be directly converted into a
numeric date, time, timestamp in the format YYYYMMDD, HHMMSS,
YYYYMMDDHHMMSS)
In this way you only need to convert your character date into a real date
and convert the result into a numeric value:
The following SQL code works on my 7.3 machine:
Dec(Date(CharDate), 8, 0)
Using VarChar_Format might be a little more complicated:
Dec(VarChar_Format(CharDate, 'YYYYMMDD'), 8, 0)
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.