Re: Compare two date into the same table
- From: "Alex_Firenze" <alessandro.caforio@xxxxxxxxx>
- Date: 4 Oct 2005 07:30:32 -0700
Hi Michael,
I think you are right. It is something related to the fact that in my
query I didn' take into account Null values in the join. (by the way,
now I know the NZ function)
However, the query you advice me is not working...
If I remove the WHERE condition on the second date and I display the NZ
result:
SELECT
pres_1.referencedate,
pres.location,
pres.class,
pres.npeople,
Val(Nz([pres_1].[npeople],0)) AS nz_people,
CDate(Nz([pres_1].[referencedate],#1/1/2005#)) AS nzdate
FROM
pres LEFT JOIN pres AS pres_1 ON (pres.class = pres_1.class) AND
(pres.location = pres_1.location)
WHERE (((pres.referencedate)=#2/1/2005#));
I get this result:
referencedate location class npeople nz_people nzdate
01/02/2005 london math 90 90 1/2/2005
01/01/2005 london math 90 100 1/1/2005
01/02/2005 london finance 85 85 1/2/2005
01/01/2005 london finance 85 80 1/1/2005
01/02/2005 london statistics 40 40 1/2/2005
01/01/2005 london statistics 40 50 1/1/2005
01/02/2005 brighton statistics 12 12 1/2/2005
01/01/2005 brighton statistics 12 15 1/1/2005
01/02/2005 brighton math 15 15 1/2/2005
If i insert now the condition nzdate=#01/01/2005# I get the same stuff
as before... Brighton-Math-15 desappear...
So, it seems that it is not possible to do it in a "clean
way"...Probably I should first build a temporary table with the result
at 01/01/2005 and then run the query with an outer join...
Any idea?
.
- Follow-Ups:
- Re: Compare two date into the same table
- From: Michel Walsh
- Re: Compare two date into the same table
- References:
- Compare two date into the same table
- From: Alex_Firenze
- Re: Compare two date into the same table
- From: Michel Walsh
- Compare two date into the same table
- Prev by Date: query for date using form
- Next by Date: Export to a text file question
- Previous by thread: Re: Compare two date into the same table
- Next by thread: Re: Compare two date into the same table
- Index(es):
Relevant Pages
|