Please Help with SQL Syntax - Last record displayed

  • Thread starter Thread starter robkiolbasa
  • Start date Start date
R

robkiolbasa

Hello, I could probably find this by searching through some reference
material but was hoping someone here had a quick answer for me. I want
to get the query below to work by displaying the information for the
MAX value. I only need assistance on the where clause portion that is
in asterics:

INSERT INTO Comment ( chg_ref_num, description, Analyst, time_stamp,
[Date] )


SELECT AHD_chg.chg_ref_num,
(AHD_chgalg.description),
(Analyst.Analyst),
(AHD_chgalg.time_stamp),
([time_stamp]/86400+25568.833) AS Expr1


FROM (AHD_chg INNER JOIN AHD_chgalg ON AHD_chg.id =
AHD_chgalg.change_id)

INNER JOIN Analyst ON AHD_chgalg.analyst = Analyst.id

WHERE (((AHD_chgalg.type) Like "LOG") AND ****((AHD_chgalg.time_stamp)
is the highest value)****


GROUP BY AHD_chg.chg_ref_num;

Any help is apprieciated
 
On 8 Aug 2006 13:35:11 -0700, "robkiolbasa" <[email protected]>
wrote:

A Subquery should work for this, if I understand correctly:

WHERE (((AHD_chgalg.type) Like "LOG") AND ((AHD_chgalg.time_stamp) =
(SELECT Max([AHD_chgalg.time_stamp) FROM [AHD_chgalg] AS X WHERE
X.change_id = AHD_chgalg.change_id);


John W. Vinson[MVP]
 
Back
Top