Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number registered for a month

Status
Not open for further replies.

jsiimml

Programmer
Feb 14, 2006
10
GB
Hi, I have a customers table with the following structure:

- id (auto number)
- datecreated (date/time)

I wish to return the the number of people who have registered for the current month and previous 3 months. Appreciate the help. Thanks
 
Typed, untested:
SELECT Count(*) AS CountOfRegistered
FROM tblCustomers
WHERE Format([datecreated],'yyyymm') BETWEEN Format(DateAdd('m',-3,Now()),'yyyymm') And Format(Now(),'yyyymm')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top