Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    Pittsburgh
    Posts
    1

    Unanswered: Agregate Function with Select Statement

    Need help....

    How do I combine the following two statements? I'm using them in ASP connected to Access DB.

    SqlJunk = " SELECT SUM(MSD+Methods+Analysis+Architectures+Models+Stud io+Elective1+Elective2+Elective3) As PersonTotals FROM tblpersons "
    SqlJunk = SqlJunk & " WHERE User_Id=" & Request.Form("DaInBox")

    SqlJunk = "SELECT FirstName, LastName, WeekNo, ProgramName, StudioTeamName FROM tblpersons"
    SqlJunk = SqlJunk & " WHERE User_Id=" & Request.Form("DaInBox")

    Thanx

  2. #2
    Join Date
    Nov 2003
    Posts
    91
    I'm not sure what you're trying to do but here's one method:

    SqlJunk = " SELECT FirstName, LastName, WeekNo, ProgramName, StudioTeamName,
    SUM(MSD + Methods + Analysis + Architectures + Models + Studio + Elective1 + Elective2 + Elective3) As PersonTotals FROM tblpersons "
    SqlJunk = SqlJunk & " WHERE User_Id=" & Request.Form("DaInBox")
    SqlJunk = SqlJunk & " GROUP BY FirstName, LastName, WeekNo, ProgramName, StudioTeamName"

Posting Permissions

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