sql statement

Results 1 to 2 of 2

Thread: sql statement

  1. #1
    Join Date
    Dec 1969

    Default sql statement

    I have a table that looks like this: and is called "Course"<BR><BR>CourseID(autonumber) Course<BR>1 Algebra<BR>2 Biology<BR>3 History<BR><BR>I am inserting new courses all the time, say for example I was to Insert the course "French", it would give me an ID of 4,(simple) but I also need that CourseID in my other table called Training. I know how to Insert the record into the table-Course, but how do I send that "new" autonumber "4" over to the "Training" table (f. key) the same time when I insert the record? This is kinda like two autonumber fields, but also not because I need to Delete Records. anyway, any help would be great, thanks

  2. #2
    Join Date
    Dec 1969

    Default Make another

    select statement to select the autonumber field in the descending order picking up the TOP 1, this will give you the most recent value and then insert it.

Posting Permissions

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