Ask a Question related to ASP Database, Design and Development.
-
Mike Hill #1
SQL Query problem...
Here is a query I am trying to execute.
SELECT ConsultantPIN, CFirstName, CLastName, Count(DateSubmitted) AS [Total]
FROM consultant_DS WHERE DateSubmitted >=#02/01/2004# and DateSubmitted
<=#2/29/2004# Group By ConsultantPIN, CFirstName, CLastName Order By Total
DESC;
My problem is that I am trying to use Total from ...Count(DateSubmitted) AS
[Total].... in the Order By Statement.
It will not let me. I can use ConsultantPIN, CFirstName or CLastName.
Any suggestions.
Thanks,
Mikeal
Mike Hill Guest
-
Query problem, please help.
mysql Ver 12.22 Distrib 4.0.24, for pc-linux-gnu (i386) gives me: The following database Error occured: You have an error in your SQL syntax.... -
***Sql Query problem
Randy Webb wrote: SELECT DISTINCT OrderID FROM trans WHERE Trans_ID = 1 AND OrderID NOT IN (SELECT DISTINCT OrderID FROM trans WHERE Trans_ID =... -
Query of Query problem
Error Executing Database Query. Query Of Queries runtime error. Table named "DATA" was not found in Memory. It is misspelled, or the table is... -
Query on Query and CF casting problem
I am using a custom tag in MX7 that was working fine in 5 that renders a table. The input to the custom tag is a query and it's columns along with... -
query problem
SELECT top5.PRODID, p.PRODNAME FROM ( SELECT TOP 5 SALES = COUNT(*), PRODID FROM SALES GROUP BY PRODID ORDER BY SALES DESC ) AS top5 INNER JOIN... -
Aaron Bertrand [MVP] #2
Re: SQL Query problem...
ORDER BY Count(DateSubmitted) DESC
?
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Mike Hill" <mhill7272(at)hotmail.com> wrote in message
news:OnDTz3DGEHA.3984@TK2MSFTNGP10.phx.gbl...> Here is a query I am trying to execute.
>
> SELECT ConsultantPIN, CFirstName, CLastName, Count(DateSubmitted) AS
> [Total]
> FROM consultant_DS WHERE DateSubmitted >=#02/01/2004# and DateSubmitted
> <=#2/29/2004# Group By ConsultantPIN, CFirstName, CLastName Order By Total
> DESC;
>
> My problem is that I am trying to use Total from ...Count(DateSubmitted)
> AS
> [Total].... in the Order By Statement.
> It will not let me. I can use ConsultantPIN, CFirstName or CLastName.
>
> Any suggestions.
>
> Thanks,
> Mikeal
>
>
Aaron Bertrand [MVP] Guest
-
Mike Hill #3
Re: SQL Query problem...
Thanks!
That did it.
"Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
news:O$Bu56DGEHA.3724@TK2MSFTNGP11.phx.gbl...Total> ORDER BY Count(DateSubmitted) DESC
>
> ?
>
> --
> Aaron Bertrand
> SQL Server MVP
> [url]http://www.aspfaq.com/[/url]
>
>
> "Mike Hill" <mhill7272(at)hotmail.com> wrote in message
> news:OnDTz3DGEHA.3984@TK2MSFTNGP10.phx.gbl...> > Here is a query I am trying to execute.
> >
> > SELECT ConsultantPIN, CFirstName, CLastName, Count(DateSubmitted) AS
> > [Total]
> > FROM consultant_DS WHERE DateSubmitted >=#02/01/2004# and DateSubmitted
> > <=#2/29/2004# Group By ConsultantPIN, CFirstName, CLastName Order By>> > DESC;
> >
> > My problem is that I am trying to use Total from ...Count(DateSubmitted)
> > AS
> > [Total].... in the Order By Statement.
> > It will not let me. I can use ConsultantPIN, CFirstName or CLastName.
> >
> > Any suggestions.
> >
> > Thanks,
> > Mikeal
> >
> >
>
Mike Hill Guest



Reply With Quote

