min() as criteria in a query

  • Thread starter Thread starter Christian
  • Start date Start date
C

Christian

Hi NG,

Going nuts here. I have a query where I would like restrict the result of
records returned.

I insert a calculated column to the query like:
PeriodSeq:
(([TblCalendar.Year]-2004)*12)+Val(Right([TblCalendar.CompanyPeriod];2))

this will return 1 for Jan2004, 12 for Dec2004,13 for Jan2005 and so on.
And this works just fine.

Now would I would like to do is to restict the records returned by adding
this criteria under the calculated field.

<=(Min([PeriodSeq])+3)

so if the lowest value of all the records in the query for PeriodSeq =11
then I would like see all records which has PeriodSeq with values from
11-14. If I type in <=14 it works.

<=(Min([PeriodSeq])+3) I just get all the records so the min() thing is not
really working out for me.

Any tips will be greatly appreciated.
-Chr
 
Solved it be creating a seperate query that calculated the MinPeriod and
then linked that query to my main query
- Chr
 
Back
Top