Update below.
I'm trying to make my own external join, which for each record returns it and all other records that appear later, or NULL if it is the last record itself. This is my sql code:
SELECT A.[CR
My problem is that when for a given [CR #], A.REGIS_STATUSDATE is maximum (and therefore B.REGIS_STATUSDATE cannot be greater than this), this line is not included in my result.
For example, if CR_ADMIN_REGIS_STATUS looks like this:
CR
I expect the result of my query to be
CR
Instead, I get the following:
CR
Given that my query is a LEFT OUTER JOIN and I don't have a WHERE clause, I expect all the rows from my source table to be the result, but that is not the case. What am I missing here?
Edit: this is in Access 2007
Update. I decided to see what happens if I copy the sections of the CR_ADMIN_REGIS_STATUS table into a separate table and run my query. Even when I just copied the whole table to a new one (manually), the query works! It was only in the case when we actually copied and pasted, when I would select * In another table the problem would remain. In the end, I found that if I ran the query with
SELECT * FROM CR_ADMIN_REGIS_STATUS UNION ALL SELECT TOP 1 * FROM CR_ADMIN_REGIS_STATUS;
and not CR_ADMIN_REGIS_STATUS my request itself returned the desired result. Weird I also had a similar query to a similar table that worked from the very beginning, so it seems like it was a problem limited to this single table.
source share