If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > Agregate Function with Select Statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-07-03, 15:08
Lili Lili is offline
Registered User
 
Join Date: Dec 2003
Location: Pittsburgh
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 12-13-03, 16:50
vanekl vanekl is offline
Registered User
 
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"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On