sql - Minimum of dates selection in Access -
i have date clause selection of data. there 2 date fields on form 'oberflache' start
, end
. want choose minimum of 2 fields. i.e should choose record based on date comes first.here code trying with.
parameters [forms]![oberflache]![start] datetime, [forms]![oberflache]![end] datetime; select lau.an, lau.ve, lau.du, lau.sta, lau.a, lau.b, lau.sw, lau.po laufzettel min(fix(lau.a)) between forms![oberflache]!start , forms![oberflache]!end)) or min(fix(lau.b)) between forms![oberflache]!start , forms![oberflache]!end;
where an,ve,du,sta,a,b,sw,po fields table lau. cases
lau.a lau.b 1.11.2016 5.11.2016 2.11.2016 3.11.2016 20.10.2016 4.11.2016 4.11.2016 28.10.2016
here when give start , end dates 1.11.2016
, 4.11.2016
. want records selected in such way if date of lau.a or lau.b before 1.11.2016
in 3rd record or 4th record must left out , first 2 selected.
with code tried
it gives me error cannot have aggregate function in clause
. alternative above?
Comments
Post a Comment