Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Filling a field from a primary key

Discussion in 'Information Technology' started by graffbp, Jul 28, 2006.

  1. graffbp

    graffbp
    Expand Collapse
    Guest

    I have a primary key that is based on SSN's. I have an external system that
    uses the last five digits for a ID number. I need to have the ID for the
    external system (which is a field in my table) to populate automatically
    from the primary key.

    Any suggestions would be appreciated.
     
  2. Loading...

    Similar Threads Forum Date
    1984 DSGMC dilly delaying for filling case against Kamal Nath, alleges Phoolka History of Sikhism May 31, 2010
    Kamdhayn/ਕਾਮਧੇਨ & Wish-fulfilling Elysian Tree. Spiritual Articles Jul 20, 2009
    Sikh News BSP accuses Punjab govt of not fulfilling promise (Outlook India) Breaking News Oct 4, 2007
    Fulfilling one's hopes Gurmat Vichaar Jul 5, 2006
    Superbly fulfilling Spiritual Articles Jan 7, 2006

  3. George Walsh

    George Walsh
    Expand Collapse
    Guest

    uRe: Filling a field from a primary key

    If you have a field named SSN in a table which contains the Social Security
    Number (say it does not include dashes, just digits - but it is formatted as
    a string rather than a number), and you want another field in your table to
    automatically populate with just the rightmost five digits from the Social
    Security Number field, then you could design and use a query which is based
    on your table, and use the calculated field method to create a field named
    "ID Number" with the formula: ID Number: =
    Right$([MyMainTableName]![SSN],5). Design your forms, reports, etc. using
    the Query rather than the Table, and the (separate) automatically calculated
    "ID Number" field will be available for every record.

    The logic is to minamalize the fields of data you actually store in a
    table - especially when one field can be derived from another and is not an
    absolutely unique piece of information relating to the subject of the table.

    "graffbp" <graffbp@discussions.microsoft.com> wrote in message
    news:08B30B04-71BD-4AAD-AB72-AB86CCDB88DA@microsoft.com...
    >I have a primary key that is based on SSN's. I have an external system
    >that
    > uses the last five digits for a ID number. I need to have the ID for the
    > external system (which is a field in my table) to populate automatically
    > from the primary key.
    >
    > Any suggestions would be appreciated.
     
  4. graffbp

    graffbp
    Expand Collapse
    Guest

    RE: uRe: Filling a field from a primary key

    Thank you. That worked great.

    "George Walsh" wrote:

    > If you have a field named SSN in a table which contains the Social Security
    > Number (say it does not include dashes, just digits - but it is formatted as
    > a string rather than a number), and you want another field in your table to
    > automatically populate with just the rightmost five digits from the Social
    > Security Number field, then you could design and use a query which is based
    > on your table, and use the calculated field method to create a field named
    > "ID Number" with the formula: ID Number: =
    > Right$([MyMainTableName]![SSN],5). Design your forms, reports, etc. using
    > the Query rather than the Table, and the (separate) automatically calculated
    > "ID Number" field will be available for every record.
    >
    > The logic is to minamalize the fields of data you actually store in a
    > table - especially when one field can be derived from another and is not an
    > absolutely unique piece of information relating to the subject of the table.
    >
    > "graffbp" <graffbp@discussions.microsoft.com> wrote in message
    > news:08B30B04-71BD-4AAD-AB72-AB86CCDB88DA@microsoft.com...
    > >I have a primary key that is based on SSN's. I have an external system
    > >that
    > > uses the last five digits for a ID number. I need to have the ID for the
    > > external system (which is a field in my table) to populate automatically
    > > from the primary key.
    > >
    > > Any suggestions would be appreciated.

    >
    >
    >
     

Share This Page