how do I add dates to sub query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, there I'm a newbie at access and would appreciate some help.
I'm trying to select rows from the preadate table that are not in the
shipdate table (which I can do, see sql view below)) but I need to drill down
further, by only omitting records that the shipdate is less than or equal to
the preadate(for each record)

SELECT testpreadate.abc, testpreadate.MODEL, testpreadate.PREDATE
FROM testpreadate LEFT JOIN testshipdate ON testpreadate.abc =
testshipdate.abc
WHERE (((testshipdate.abc) Is Null));

Any help woul be appreciated.
 
It looks like you just need to add another condition to your where
clause;

WHERE (((testshipdate.abc) Is Null) OR (testshipdate.abc <=
testpredate.abc);
 
Thanks for your input but that didn't work. When I did this I got one
record back, when it should have been four records. I've put the two
tables below to see if this make my request any clearer.
Really appreciate your help so far.


IMEI MODEL PREDATE
111111 modela 27/03/2006
111111 modela 08/04/2006
111111 modela 01/05/2006
222222 modelb 28/03/2006
222222 modelb 02/04/2006
222222 modelb 09/04/2006
333333 modelc 01/04/2006
333333 modelc 05/05/2006
444444 modeld 27/03/2006


IMEI MODEL SHIPDATE
111111 modela 27/03/2006
111111 modela 08/04/2006
222222 modelb 28/03/2006
222222 modelc 02/04/2006
333333 modelc 01/04/2006
 
Back
Top