Alpha Video Training
Results 1 to 3 of 3

Thread: parent child link failure

  1. #1
    Camille Venners
    Guest

    Default parent child link failure

    My data began in db III. I opened it in A5v5, created a set with a one-to-one parent child link. The linking fields are numeric (building+unit) in both tables. Some, but not all, links between the tables are accurate.

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: parent child link failure

    Camille,

    The + operator used between two numeric fields will sum them together. Most would be using char type fields, stuffed with numeric chars in their indexkeys. The + operator with char type fields will concatenate them, which is what most would want in an indexkey. An alternative for numeric fields would be to define the indexkey converting each numeric field to a char string first.


    If building is a numeric field and contains 100
    and
    Unit is a numeric field and contains 23
    then
    Building + unit returns 123.

    while

    Ltrim(str(building))+ltrim(str(unit))
    would return 10023


    You'll get consistent sorting results if you also arrange for your indexkey to have a fixed width, and in the case of numeric characters, if they're right justified, or left padded with zeros.

    -- tom

  3. #3
    "Certified" Alphaholic forskare's Avatar
    Real Name
    Ken Nordin
    Join Date
    Apr 2000
    Location
    Walker, MN
    Posts
    7,545

    Default RE: parent child link failure

    Tom is correct. Numeric fields should ONLY be used for math calculations. Phone number, zip code, ID number and like type fields do not perform a mathematical equation. Thus, when you use the fields as you're using them, any use of + / * - will cause a mathematical calculation.

    It can be OK to use numeric fields for what you want but as Tom pointed out, you must convert numeric to character to prevent the mathematical calculation.

    kenn

Similar Threads

  1. Parent/Child
    By bmann3 in forum Alpha Five Version 6
    Replies: 4
    Last Post: 07-15-2005, 02:00 PM
  2. Parent key and Child key
    By David Morgan in forum Alpha Five Version 6
    Replies: 6
    Last Post: 01-30-2005, 01:34 PM
  3. Parent - child
    By Jan Nielsen in forum Alpha Five Version 5
    Replies: 6
    Last Post: 03-08-2004, 04:03 AM
  4. Should -Can- a parent be it's own child?
    By Scott Axton in forum Alpha Five Version 5
    Replies: 4
    Last Post: 09-02-2003, 05:11 PM
  5. Can Parent be a Child?
    By Jeff Stevens in forum Alpha Five Version 4
    Replies: 1
    Last Post: 03-04-2003, 06:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •