Query

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

Guest

Hello all..

I need some help creating a query. This is the scenario:
- I need to COUNT all records that are ACTIVE (I have a checkbox, = True)..I got this one
- AND the records must have an ACTIVEDATE (in tblClientInfo) between the STARTDATE and ENDDATE (separate form) that the user enters prior to the query running...I got this also
- AND the records must be >=18 AND <=34

I have a Birthdate Field in my table tblClientInfo...
I dont know how to do an expression or calculation within a query so I can capture all 18 to 34 year olds...I have tried so many ways, but no luck...

So, I need a count of all active 18 to 34 year olds that became active between a given date range...

Please any help is appreciated

Thanks
GB
 
See The Access Web article:

http://www.mvps.org/access/datetime/date0001.htm

on how to calculate Age and then you can put the criteria on the Calculated
Age column.

--
HTH
Van T. Dinh
MVP (Access)



Gavin said:
Hello all..

I need some help creating a query. This is the scenario:
- I need to COUNT all records that are ACTIVE (I have a checkbox, = True)..I got this one
- AND the records must have an ACTIVEDATE (in tblClientInfo) between the
STARTDATE and ENDDATE (separate form) that the user enters prior to the
query running...I got this also
- AND the records must be >=18 AND <=34

I have a Birthdate Field in my table tblClientInfo...
I dont know how to do an expression or calculation within a query so I can
capture all 18 to 34 year olds...I have tried so many ways, but no luck...
 
But how do I do this for a query?
See The Access Web article:

http://www.mvps.org/access/datetime/date0001.htm

on how to calculate Age and then you can put the criteria on the Calculated
Age column.

--
HTH
Van T. Dinh
MVP (Access)




STARTDATE and ENDDATE (separate form) that the user enters prior to the
query running...I got this also
capture all 18 to 34 year olds...I have tried so many ways, but no luck...
 
In an empty Column of the Query Grid, type in the "Field" row:

Age: DateDiff("yyyy", [Bdate], Now())+ _
Int( Format(now(), "mmdd") < Format( [Bdate], "mmdd") )

(type as ONE line and replace [Bdate] with the the appropriate Field name
from your set up).

Check Access Help / Access books on Calculated Fields.

--
HTH
Van T. Dinh
MVP (Access)




Gavin said:
But how do I do this for a query?
On the frmClientInformation form I do have an unbound textbox that
displays the client's age, but when running the query, I need to some how do
the same calculations for the count in the query.
 
Back
Top