Hi,
99/99/9999 is not a valid date and cannot be moved to a timestamp field.
What you can do is to wrap the date field with an IF statement or write a
function that will return the maximum timestamp
('9999-12-31-24.00.00.000000')
If MyCharDate = '99/99/9999';
MyTimestamp = *Hival;
Else;
MyTimeatamp = %Date(MyCharDate: *USA);
EndIf;
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von William Howie
Gesendet: Friday, 17.5 2013 22:15
An: rpg400-l@xxxxxxxxxxxx
Betreff: Date question
Hello all,
I have a situation where I need to take an alpha field containing a date in
the format of '99/99/9999' and load it into a field of type 'Z' (timestamp).
The program I'm doing this in is free-format. Any suggestions? Thanks in
advance!
Bill
________________________________
Confidentiality Notice: This email message is intended only for the
individual or entity to which it is addressed. This email may contain
information that is proprietary or privileged, confidential and exempt from
disclosure under applicable law. If you are not the intended recipient, you
are hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you received this email by
accident, please notify the sender immediately and destroy this email and
all copies of it.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.