DonorHub ®
Bridging the information gap between you and your staff...
Understanding DonorHub Lite » Custom Integration Guide > Essential Concepts » Scan Codes
Scan Codes

Contents

Syndication

Scan Codes

Print this Topic Previous pageReturn to chapter overviewNext page

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. DonorHub Lite 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.

Read More > Rescan Method

Read More > "Source" Query

Scan Code Target Fields In Depth

Scan codes common to each query.

Scan Code (Numeric Fiscal Period)

(Integer)

Optional

Year and month encoded as a number: (Year * 12) + (Month - 1)

Scan Code (Date/Time)

(DateTime)

Optional

Date and time. This scan code field cannot be combined with any others.

Scan Code (Date)

(DateTime)

Optional

Date and time. This scan code field cannot be combined with any other date scan-codes. You may still provide a time-based scan code.

Scan Code (Time)

(DateTime)

Optional

When providing the time, the date must also be specified using one or more of the scan code fields.

Scan Code ("YYYYMMDD")

(Text (8))

Optional

Year, month and day represented as 8 characters.

Scan Code ("YYYYMM")

(Text (6))

Optional

Year and month represented as 6 characters.

Scan Code ("YYYY")

(Text (4))

Optional

Year represented as 4 characters.

Scan Code ("MM")

(Text (2))

Optional

Month represented as 2 characters. Must be used with ScanCode_YYYY.

Scan Code ("DD")

(Text (2))

Optional

Day (within the month) represented as 2 characters. Year and month must be specified by one or more of the other scan code fields.

Scan Code (Numeric)

(Integer)

Optional

A whole number without any fractional parts. This scan code field can not be combined with any others.

Scan Code (Custom)

(Text (15))

Optional

A custom scan code, up to 15 characters. This scan code field can not be combined with any others.

 




© 2018 TntWare | Privacy | Terms of Use