Mark records with ID as they are entered

  • I am new at this so please bear with me.

    I have a database with a billing table and an Account table.

    The Account table has customer info Name address etc in it.

    The billing table has records added on the fly.  I have an AcctID field in both tables.  I need to be able to update the billing table with the existing AcctID in  Account table.

    So an exaple is:

    Account table

    AcctID:100 Name:John Doe Address:123 main

    Billing Table

    AcctID:100 Customer:John Doe Billed:$55.00

    When the record is first entered into the Billing table the AcctID is null.

    Any Help would be great

    Josh

     

  • --Account table

    INSERT INTO Account (AcctID, Name, Address)

    SELECT 100, 'John Doe', '123 main'

    --Billing Table

    INSERT INTO Billing (AcctID, Customer, Amount)

    SELECT 100, 'John Doe', 55.00

    Andy

  • Thank You

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply