Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > BOOK: Professional SQL Server 2000 Programming
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional SQL Server 2000 Programming
This is the forum to discuss the Wrox book Professional SQL Server 2000 Programming by Robert Vieira; ISBN: 9780764543791
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server 2000 Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 20th, 2007, 01:55 AM
Registered User
 
Join Date: Mar 2006
Location: Barula, Gujarat, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mitulkoradia
Default Problem With FIRST () Agregate function

hi

can any one help me to find the solution on my following problem

i am creating one Crostab query like done in ms Access. but there is one problem.

i have to use. FIRST() Aggregate function like SUM() AVG()

you can find help for that function from here..

http://www.w3schools.com/sql/sql_functions.asp

it says the FIRST Function is not supported in SQL Server 2000..

i want the same functionality as First() give. (First Row's Specified value of Group).

here i am giving you my sample query.

Code:
SELECT  qryRisk_Matrix.SystemName, qryRisk_Matrix.SAPFunctionalLocation, qryRisk_Matrix.SystemID, qryRisk_Matrix.BusinessName, 
                      qryRisk_Matrix.RegionName, qryRisk_Matrix.SchemeName, qryRisk_Matrix.CMSID, qryCapProjCount.CountOfProjectID, 
                      qrySwppProjCount.SwppProjCount,
                      'W-WQ' =FIRST(CASE RiskEventRef WHEN 'W-WQ' THEN qryRisk_Matrix.Risk0 END), 
                      'W-NH' = FIRST(CASE RiskEventRef WHEN 'W-NH' THEN qryRisk_Matrix.Risk0 END) FROM         qrySwppProjCount INNER JOIN
                      (qryCapProjCount INNER JOIN
                      qryRisk_Matrix ON qryCapProjCount.SystemID = qryRisk_Matrix.SystemID) ON qrySwppProjCount.SystemID = qryRisk_Matrix.SystemID
WHERE     (((qryRisk_Matrix.BusinessName) = 'Regulated Water'))
GROUP BY qryRisk_Matrix.SystemName, qryRisk_Matrix.SAPFunctionalLocation, qryRisk_Matrix.SystemID, qryRisk_Matrix.BusinessName, 
                      qryRisk_Matrix.RegionName, qryRisk_Matrix.SchemeName, qryRisk_Matrix.CMSID, qryCapProjCount.CountOfProjectID, 
                      qrySwppProjCount.SwppProjCount
Mitul N Koradia
__________________
Mitul N Koradia
Reply With Quote
Reply


Thread Tools
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 Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Round Function darrenb Access 3 May 22nd, 2007 05:45 PM
Date Function problem beetle_jaipur Classic ASP Basics 5 July 6th, 2006 01:08 PM
Problem with function mat41 Classic ASP Basics 3 July 16th, 2005 01:19 AM
shell function problem bml Excel VBA 1 February 12th, 2005 04:42 PM
Problem with a Javascript function SuMajestad PHP How-To 4 August 17th, 2004 09:04 PM



All times are GMT -4. The time now is 03:54 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.