A few things:
Date is a reserved word in Access. You ruse of Date could confuse/lead to unexpected results.
If you insist on using Date as a variable name, then enclose it in [ and] eg [Date]
Variables and field names should not have embedded spaces in Access. Again,if you isnsist on such naming then again use [ and ] eg. [Table 1]
Much easier, and you'll have fewer syntax errors by using names that are alphanumeric and "_"(underscore) only.
I don't understand this comment:
Problem is that date doesn't have a value.
I see date values for each record in your sample data.
In a normalized design you would not have 2 records with same values in all fields
Code:
1 10/25/2013 S 2836
1 10/25/2013 S 2836
What exactly do you want returned? Can you show us from the data provided, what would the result be?
Code:
SELECT ChlorateByWell.wellbore
, ChlorateByWell.Mdate
, ChlorateByWell.mtype
, ChlorateByWell.chlorate
FROM ChlorateByWell
WHERE
(((ChlorateByWell.mtype)="S") AND
((ChlorateByWell.Mdate)=(select max(mdate) from chlorateByWell as XXX
where mtype = "s")));
which returns
Code:
wellbore |
Mdate |
mtype |
chlorate |
1 |
10/25/2013 |
S |
2836 |
1 |
10/25/2013 |
S |
2836 |