Alpha Video Training
Results 1 to 2 of 2

Thread: When importing excel records, check if value exist before creating records

  1. #1
    Real Name
    Cornelius Laubscher
    Join Date
    Oct 2013

    Post When importing excel records, check if value exist before creating records


    I have a table called ClassPoints with the following fields in it;
    1. EventName [Race Event Name]
    2. EventDate [Race Event Date]
    3. IDNumber [Competitor IDNumber]
    4. FirstName [Competitor FirstName]
    5. LastName [Competitor LastName]
    6. RaceNr [Competitor Race Number]
    7. Class [Race class entered i.e. OR1, OR2]
    8. RacePosition [Race result position]
    9. ClassPoints [Points achieved according to Position]
    10. DNF [Did not finish race]
    11. DNS [Did Not Start race]

    • Race results are imported after each event is completed
    • Each event have multiple competitors per event and each competitor can ride multiple events

    If 3 races [EventName] have been completed and the results was imported already and competitor x [IDNumber] did not enter/partake in this 3 races [EventName] BUT competitor x [IDNumber] enters and completes race 4 in the OR1 class, the following must happen when the race 4 [EventName] results are imported:

    • System must check current records and "eventname" results already in the table for Competitor x [IDNumber]. If it does not exist in any of the "completed" events already uploaded, then a matching record for this competitor must be created for the races he did not enter and also in the class OR1 of the race 4 he did enter. The DNS field must then be set to Yes to ensure that the true race entries can be identified for that 3 races
    • Because this is a series, the competitor x [IDNumber] must be penalised for NOT entering the previous 3 races [EventName] by adding 25 points to the RacePosition field for the previous 3 races HOWEVER NB!!!
    • We must count the true race entries per class for race 1 [EventName] and add the 25 to that total entries, same with race 2 and race 3 he did not enter

    All the above happens during the Import process of Race 4 results and all to the same table.

    EventName = IDNumber = Class , is the 3 fields that we use to identify the individual records/entries

    Where/how on earth do I start with this . The imports works great, reports work great, but I need the above to work so we can calculate overall race results and season results.
    Last edited by Corne; 12-21-2013 at 03:14 AM.

  2. #2
    "Certified" Alphaholic kingcarol's Avatar
    Real Name
    Carol King
    Join Date
    Jun 2010

    Default Re: When importing excel records, check if value exist before creating records

    If you are using some sort of sql tables, then read this article about doing count and insert queries using Xbasic.
    Carol King
    Developer of Custom Homebuilders' Solutions (CHS)

Similar Threads

  1. Some records have blank characters when importing from Excel 2010 file
    By joobeng in forum Alpha Five Version 10 - Desktop Applications
    Replies: 0
    Last Post: 08-21-2013, 12:11 PM
  2. Importing records from excel into a grid
    By soadyc in forum Application Server Version 11 - Web/Browser Applications
    Replies: 5
    Last Post: 08-05-2012, 06:26 AM
  3. Creating new records from old records
    By Pat Bremkamp in forum Web Application Server v7
    Replies: 4
    Last Post: 05-26-2006, 07:57 AM
  4. Records continue to exist
    By Harold Bussell in forum Alpha Five Version 5
    Replies: 2
    Last Post: 10-03-2004, 01:11 PM
  5. Importing Records
    By Tedacria in forum Alpha Five Version 4
    Replies: 1
    Last Post: 08-17-2003, 12:16 PM


Posting Permissions

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