Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003

    Exclamation Unanswered: Help .. Primary Key in Make Table Query

    Is there anyone out here who can tell me how to set a primary key in a make table query. I need to define the field "number" as the primary ID.

    SELECT [tblReport Summary - FINAL].Month, Sum([tblReport Summary - FINAL].Received) AS Received, Sum([tblReport Summary - FINAL].[For Info Only]) AS [For Info Only], Sum([tblReport Summary - FINAL].Assigned) AS Assigned, Sum([tblReport Summary - FINAL].Complete) AS Complete, nz([Received])-nz([For Info Only])-nz([Complete]) AS Outstanding, tblMonth.Number INTO [tblReport Summary - MONTH]
    FROM tblMonth INNER JOIN [tblReport Summary - FINAL] ON tblMonth.tblMonth = [tblReport Summary - FINAL].Month
    GROUP BY [tblReport Summary - FINAL].Month, tblMonth.Number
    Primary Key = (tblMonth.Number);

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    not sure you can do it using INTO syntax

    can you run another query right after that one?

    ALTER TABLE [tblReport Summary - MONTH]
    ADD CONSTRAINT PK_Number PRIMARY KEY (Number) | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    May 2003
    That will work just fine .... thank you very much!

Posting Permissions

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