|
Scan Codes |
Top Previous Next |
|
Concepts and Theory A scan code is just a string of up to 15 characters. A scan code is most commonly a textual encoding of a number or date. The most important aspect of a scan code is that it should be encoded in such a way that the most significant characters are leftmost. This allows for scan codes to be correctly compared and sorted relative to each other.
For example, you would NOT textually encode the numbers 1, 3, 15 and 29 as: "1", "3", "15" and "29" because when sorted you'd have: "1" "15" "29" "3"
A better way to encode the numbers would be to encode them as "01", "03", "15" and "29" because then they would be sorted as follows: "01" "03" "15" "29"
However, we are still limited to only 2 digits. To further improve upon this idea would be to use all 15 characters available in a scan code: "000000000000001" "000000000000003" "000000000000015" "000000000000029"
Now, let's apply this thinking to dates and time. It would follow that we should put the most significant component of dates and time (the year) to the leftmost. "YYYY"
A full encoding, using all 15 characters, of date and time could be as follows, where "YYYY" is year, "MM" is month, "DD" is day of the month, "hh" is the hour (24-hour clock), "mm" is minutes, "ss" is seconds, and "a' is the tenth of the second: "YYYYMMDDhhmmssa"
You could drop less significant part of the value, but never the most significant parts. For example, you couldn't have a time without a date.
Scan Codes as Target Fields When a source query is limited by a scan range, it is critical that the scan code fields be targeted in the "Source" Query. TntMPD.DataServer needs to store a copy of the scan code, so that it can internally limit its own internal queries. There are many scan codes you can target. Some scan codes can be combined. For example, you could combine [Scan Code("YYYY")] and [Scan Code ("MM")] and [Scan Code ("DD")] to produce a single scan code made up of year, month and date.
Scan Code Target Fields In Depth...
Scan Code (Numeric Fiscal Period) (Integer)
|