Update query help

  • Thread starter Thread starter Mikael
  • Start date Start date
M

Mikael

I'm building a database aimed at handling subscriptions, it will be used on
the side of our business system.
I want to update a table (own databasee) with date() where the date of the
last subscription invoice (from business database) is less or equal to
date()-365.
I get an error however that I can't translate properly to english,. It says
something like this:
....Function not allowed in where instruction (could be aggregatefunction but
im not sure)

SQLCode:

UPDATE (Hemsida INNER JOIN [P:\ftg1\Kund] ON Hemsida.Nummer =
[P:\ftg1\Kund].Nummer) INNER JOIN [P:\ftg1\Prodtrans] ON
[P:\ftg1\Kund].Nummer = [P:\ftg1\Prodtrans].KundLevnr SET
Hemsida.Abb_Utgått_mail = Date()
WHERE (((Last([P:\ftg1\Prodtrans]![Datum]))<=Date()-365) AND
(([P:\ftg1\Prodtrans].Produktnr)="97-966009" Or
([P:\ftg1\Prodtrans].Produktnr)="97-966109" Or
([P:\ftg1\Prodtrans].Produktnr)="97-966309" Or
([P:\ftg1\Prodtrans].Produktnr)="97-966209"));
 
You cannot use the Last() aggregate function in the WHERE clause.

Try using the domain aggregate function DMax() instead.

Check Access Help on DMax() syntax and usage.
 
Back
Top