I am working with a date field that is described as USAGE=YYMD and ACTUAL=DATE and which holds both date and time components. In my report, I need to compare its values to those of a datetime field that is HYYMDI. I cannot change the master files.
What I do not understand from the documentation is whether the above USAGE strips the time components from the field before values are returned, or whether USAGE is only a formatting instruction for the report output while the time components are still accessible. For the comparison I am converting the field to HYYMDI using the HDTTM function, but predictably I get midnight as the time. Is there a way to get the correct time back?This message has been edited. Last edited by: <Emily McAllister>,
Windows 7 64-bit
It is the "ACTUAL=DATE" setting that is instructing the adapter to retrieve only the "date" portion from your DB column. USAGE=YYMD just is formatting to be used as '2016/04/19' for display purposes.
For you to access the "time" portion of your DB field, you'll need to have ACTUAL=HYYMDI with a compatible USAGE (such as HYYMDI). Only then you can perform any time operations you'll need.
That change has to be done at the metadata layer so if you can't change the master then you won't be able to go much further.
If the reason for not changing the master is that this field is already used in other reports and needs to be treated as a date only (no time portion), you could potentially add another field to the masterfile using the same ALIAS (so it refers to the very same DB column) along the appropriate combination of ACTUAL and USAGE as needed.
Thanks for your answer, this clears things up for me. I will ask our administrator to add another field to the master file that retains both the date and time portions, as you suggested.
Windows 7 64-bit
|Powered by Social Strata|