Without thinking about it too hard (which means this may or may not be
the real issue) it looks like you're missing a couple of 'as' clauses:

update account as a ... from history as h ...

--Ben Doom

Jeff Waris wrote:

> I guess I am having an off day with SQL. I think technically this should
> work but I get a syntax error
>
>
> UPDATE Account a
>
>
> SET a.last_update = (SELECT TOP 1 h.tranDate
>
>
>                      FROM History h
>
>
>                      WHERE a.Account_Number = h.Account_Number
>
>
>                      ORDER BY h.tranDate DESC)
>
>
> Basically what this is supposed to do is look at each account number in the
> account table. Go to the history table for that account number and grab the
> last date it sees for the history of that account number and populate the
> account table with that date.
>
>
> Any help would greatly be appreciated!
>
>
> Jeff
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to