|
Try this:
select '0991231', '1001231',
cast(left('0991231',3) as decimal(3,0)) + 1900,
cast(left('1001231',3) as decimal(3,0)) + 1900
from sysibm/sysdummy1
....+....1....+....2....+....3....+....4....+....5....+.
0991231 1001231 Numeric Expression Numeric Expression
0991231 1001231 1,999 2,000
HTH,
Loyd
Loyd Goodbar
Senior programmer/analyst
BorgWarner
TS Water Valley
662-473-5713
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of John Candidi
Sent: Tuesday, February 27, 2007 13:47
To: 'Midrange Systems Technical Discussion'
Subject: SQL Help
I have a date in the following format CYYMMDD. This is basically just a
text
field in the file. I need to take just the CYY fields and present it as
1999
or 2007 or whatever it works to out be. This conversion needs to be done
on
the fly in a view. Any help would be greatly appreciated. If anyone
needs
more info, I apologize for not supplying in advance. I created the view
using iNav on 5.2
John A Candidi
Rutgers Insurance Companies
IT Director - Iseries Manager
856-779-2274
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.