Try using [] rather than ""
SELECT MAX(Categories.CategoryID) AS [ID] FROM.....
or change the alias to somthing other that ID
SELECT MAX(Categories.CategoryID) AS MaxID FROM....
--
Kevin Marshall
WebXeL.com Ltd
http://www.webxel.com
ASP.NET Dreamweaver Extensions
http://www.webxel-dw.co.uk
"JDM" <webforumsuser@macromedia.com> wrote in message
news:e2lrrj$ns2$1@forums.macromedia.com...
> I'm trying make a dataset using a select query like:
>
> SELECT MAX(Categories.CategoryID) AS "ID" FROM
Categories
>
> When I test the query in the advanced Recordset dialog
box it works great,
> but
> of course when I put it on my page the command string
becomes:
>
> CommandText='<%# "SELECT MAX(Categories.CategoryID)
AS "ID" FROM
> Categories"
> %>'
>
> Now there's nested quotes, it doesn't work, and I'm too
thick to figure
> out
> how to nest them...
>
> Help?
>
> Thanks
>
> DOug
>
>
>
>
>