Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

SNAPSHOT OF RECORDS

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fluffy - 16 Jan 2008 19:35 GMT
I have a small database (less than 200 clients) which includes their some
basic info such as their start date & ending date.  I have created reports
for demographics (race, sex, etc.).  When I run these reports it shows me the
info for the current date, such as 45 females & 75 males.  Throughout the
year, we get new clients & lose some.  How can I get it to run these reports
for a particular date such as July 4th?  

Using Win XP & Access 2003
Douglas J. Steele - 16 Jan 2008 20:00 GMT
SELECT Gender, Count(*)
FROM MyTable
WHERE StartDate <= #07/04/2007#
AND EndDate >= #07/04/2007#
GROUP BY Gender

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have a small database (less than 200 clients) which includes their some
> basic info such as their start date & ending date.  I have created reports
[quoted text clipped - 6 lines]
>
> Using Win XP & Access 2003
Fluffy - 16 Jan 2008 20:36 GMT
Thanks Doug.  Now what do I do with what you typed?  Create a new rpt or
revise one?  I'm still learning Access.

> SELECT Gender, Count(*)
> FROM MyTable
[quoted text clipped - 12 lines]
> >
> > Using Win XP & Access 2003
Douglas J. Steele - 16 Jan 2008 23:21 GMT
That's the SQL of a query. When you build queries through the graphical
query builder, Access is actually generating SQL for you. (You can see the
SQL associated with any query by opening the query in Design view, then
switching to the SQL view on the View menu)

To generate that SQL, create a new query and select your table. Drag in the
grid the Gender field, the Start and End date fields, and one other field
that you know is guaranteed not to contain Null values (the primary key is a
good choice). Change the query into a Totals query (there's a button with a
Sigma on it on the button bar, or check on the View menu). That'll add a new
row to the grid, entitled Total:, with a default value of Group By under
every field in the grid. Change that Group By to Count under the "other"
field, and to Where under the two date fields (You should also uncheck the
two date fields). Put <= #07/04/2007# as the criteria under the StartDate
field, and >= #07/04/2007# under the EndDate field. Run the query.

You can then use that query as the basis of a report if you want.

To have it prompt you for a date, put something like [Enter The Date]
instead of #07/04/2007# under the two fields. Note that dates must be input
in mm/dd/yyyy format.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Thanks Doug.  Now what do I do with what you typed?  Create a new rpt or
> revise one?  I'm still learning Access.
[quoted text clipped - 19 lines]
>> >
>> > Using Win XP & Access 2003
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.