sql - Max function with where clause -


I am using MS Access 2007 and this is my basic SQL query:

   

But when I modify this query (below) to display the record for the latest date, I get an error saying that where I use the maximum function with the segment Can not:

  SELECT rates.UNIT, Rates.PROJECT, Rates. [Date_of_CM memo], rates Rates, Rates The rates are marked by the check, where the check (= (.UNIT) = [check]. [Unit_name]] and (max. ([Dated_ofobm mmm]) & lt; [check]. [Reg_Date])));    

You can not just enter MAX WHERE in other total functions ), but you can put query in the same way:

  SELECT Rates Unit, Rates Project, Rates [Date_ofobmmmo], rates Rates, Rates Rates from rates, checks WHERE (rates. Units) = [check]. [Unit_Name]) and (Select Rates from MAX (Rates [Date_ofMMMMO]) & lt; [check]. [Reg_Date] )));    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -