it pulls up one record.... I'll have to wait until there are more than one
records in the database before claiming victory. This is an app that has
been running against Postgres and there are a couple of MSSQL specific
changes I'm making...
in a few places... if database=MSSLQ query like this else if Postgres query
like that.
Thanks and Warm Regards to you too. I appreciate the help.
Gonz
At 04:30 PM 7/8/04, you wrote:
>Hi Gonz,
>
>It might be better to do this as a subquery like so:
>
><cfquery name="LastRowID" datasource="#attributes.datasource#">
>select eHistory.Date_Out as columnofinterest
>from eHistory
>where eHistory.Equip_ID = 2
>and eHistory.eHistory_ID IN (select max(eHistory.eHistory_ID) from
>eHistory where eHistory.Equip_ID = 2)
></cfquery>
>
>That way, you're not mixing the two different types of queries, but
>rather performaing them separately.
>
>Let us know if this works or not. ;)
>
>Warm regards,
>Jordan
>
>Gonzo Rock wrote:
>
> > using MS-SQL Server here and.... I am trying to find the largest
> > eHistory_ID record and its associated Date_Out column value for the
> > set of
> > records whose Equip_ID = 2
> >
> > <cfquery name="LastRowID" datasource="#attributes.datasource#">
> > select max(eHistory.eHistory_ID) as LastRow_ID, eHistory.Date_Out as
> > columnofinterest
> > from eHistory
> > where eHistory.Equip_ID = 2
> > </cfquery>
> >
> > is getting this error:
> >
> > Column 'eHistory.Date_Out' is invalid in the select list because it is
> > not
> > contained in an aggregate function and there is no GROUP BY clause.
> >
> > I am guessing there is some sub select sort of statement I should be
> > using
> > but... alas not hitting on it.
> >
> > Thanks,
> > Gonz
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

