J
Jackson via AccessMonster.com
Hi,
I'm trying to code a subquery on a table but to no avail...it's a very simple
table that has Date (short date, just recording the day) and NAV which is a
number (double).
All I'm wanting to do is have a query that displays the Date, the NAV and the
NAV from the day before - only recording business dates. In other words, the
subquery number I want is the NAV from the record preceeding the current one.
I've got as far as the below, but that just gets the same NAV number as
today's:
SELECT tblNAV.Date, tblNAV.NAV, (SELECT LAST(x.NAV) FROM tblNAV as X LEFT
JOIN tblNAV on x.Date=tblNAV.Date WHERE tblNAV.Date=x.Date) AS NAV2
FROM tblNAV;
Can anyone provide any guidance as to how I need to alter this?
Thanks.
I'm trying to code a subquery on a table but to no avail...it's a very simple
table that has Date (short date, just recording the day) and NAV which is a
number (double).
All I'm wanting to do is have a query that displays the Date, the NAV and the
NAV from the day before - only recording business dates. In other words, the
subquery number I want is the NAV from the record preceeding the current one.
I've got as far as the below, but that just gets the same NAV number as
today's:
SELECT tblNAV.Date, tblNAV.NAV, (SELECT LAST(x.NAV) FROM tblNAV as X LEFT
JOIN tblNAV on x.Date=tblNAV.Date WHERE tblNAV.Date=x.Date) AS NAV2
FROM tblNAV;
Can anyone provide any guidance as to how I need to alter this?
Thanks.