Single to Date Conversion

pts.
Tags:
Visual Basic
I've been asked to convert an old database made up of fixed length record files. I've deciphered all the fields using a VB program except the date fields. The old docs say the date fields are stored as single (S0) ... my question is: How to I convert these dates to a real date? The data values look like: 930501, 941201, 951130, 960331, 960430, etc. Any thoughts would be greatly appreciated!

Answer Wiki

Thanks. We'll let you know when a new response is added.

Looks like YYMMDD to me. I would try to verify this in the documentation or whatever information source you have on the old database. You could also look for inappropriate numbers like MM not between 1 and 12 and DD not between 1 and 31. If you find any inappropriate numbers than this is the wrong approach. This does not look like a date based on an offset number of days after a start date because the start date would have to be about 2600 years ago.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TSCHMITZ
    Hi, this is for sure a YYMMDD format. You only have to use the right convert instruction to the desired format (CDATE OR CVDATE). Do not forget to handle 'invalid date' (with 'isdate' function), in case of corrupted DB. Hope it may help. Regards.
    470 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following