Skip to main content
August 9, 2007
Question

Aggregate functions in a Dataset in Dreamweaver CS3

  • August 9, 2007
  • 3 replies
  • 329 views
Hi. I'm pretty new to Dreamweaver but I've created several ASP.NET (VB) pages that connect to my SQL 2005 database. The current query I'm trying to create is the first that uses aggregate functions and I keep getting an error (BC32017: Comma, ')', or a valid expression continuation expected.)

I've verified that my SQL command is correct and returning the expected data when using the test button on the dataset configuration but when I try to preview the page in IE7 I get the error above. The SQL statement I'm trying to use is:

SELECT Player_Name "Player Name", Sum(Pass_Yds) "Pass YDs", Sum(Pass_TDs) "Pass TDs"
FROM Stats
WHERE Pos = 'QB'
GROUP BY Player_Name
ORDER BY Sum(Pass_TDs) desc

If anyone has any words of wisdom, I'd really appreciate it. Thanks in advance.
Brian
This topic has been closed for replies.

3 replies

August 28, 2007
So no one has any idea how to get around this...? Anyone? :(
August 23, 2007
Thanks for the reply Randy. Unfortunately, this is not the problem. The line in my page is all on one line and no continuation character is necessary. The actual lines from my aspx page are below:

<MM:DataSet
id="QBDataSet"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_Fantasy") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_Fantasy") %>'
CommandText='<%# "SELECT Player_Name "Player Name", Sum(Pass_Yds) "Pass YDs", Sum(Pass_TDs) "Pass TDs" FROM Stats WHERE Pos = " + Chr(39) + "QB" + Chr(39) + " GROUP BY Player_Name ORDER BY Sum(Pass_TDs) desc" %>'
Debug="true"
></MM:DataSet>

The formatting here makes it look like the code crosses multiple lines, but they do not. I know the SQL is good since I get the data back that I am looking for when I test my dataset in the server behaviors setup of the DataSet, but when I try to view the page in IE, I get an error on the very first line of the text listed above. Any assistance would be greatly appreciated.

~Brian
Inspiring
August 16, 2007
Brian,

In VB, in general you can't wrap strings across lines without the
continuation character (_). So, put everything on 1 line, or try this:

SELECT Player_Name "Player Name", Sum(Pass_Yds) "Pass YDs", _
Sum(Pass_TDs) "Pass TDs" _
FROM Stats _
WHERE Pos = 'QB' _
GROUP BY Player_Name _
ORDER BY Sum(Pass_TDs) desc

HTH,
Randy


> Hi. I'm pretty new to Dreamweaver but I've created several ASP.NET (VB) pages
> that connect to my SQL 2005 database. The current query I'm trying to create is
> the first that uses aggregate functions and I keep getting an error (BC32017:
> Comma, ')', or a valid expression continuation expected.)
>
> I've verified that my SQL command is correct and returning the expected data
> when using the test button on the dataset configuration but when I try to
> preview the page in IE7 I get the error above. The SQL statement I'm trying to
> use is:
>
> SELECT Player_Name "Player Name", Sum(Pass_Yds) "Pass YDs", Sum(Pass_TDs)
> "Pass TDs"
> FROM Stats
> WHERE Pos = 'QB'
> GROUP BY Player_Name
> ORDER BY Sum(Pass_TDs) desc
>
> If anyone has any words of wisdom, I'd really appreciate it. Thanks in advance.
> Brian
>