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 / Queries / March 2006

Tip: Looking for answers? Try searching our database.

Simple query but difficult for each end of month between date rang

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter - 08 Mar 2006 07:09 GMT
I have a table that contains service calls.  I want to show the number of
service calls that were still open at the end of each month.  e.g Jan 06 - 2,
Feb 06 - 3
I have a query :
SELECT Count(*) AS Expr1
FROM tbl
WHERE ((tbl.EntryDate) Is Not Null And (dbo_tbl.EntryDate)<=[problem value])

This is only good if I type the problem value in.  But I need to automate it
so that the report returns data for date range gathered from a form.  I can
see that I need to determine the end of each month between the date range,
and run the query for each of those dates.   Is this possible in a query ...
or is this better done in a function and then somehow linking this function
to the report.
John Vinson - 08 Mar 2006 20:58 GMT
>I have a table that contains service calls.  I want to show the number of
>service calls that were still open at the end of each month.  e.g Jan 06 - 2,
[quoted text clipped - 10 lines]
>or is this better done in a function and then somehow linking this function
>to the report.

You need to call a (builtin) function from the Query:

WHERE ((tbl.EntryDate) Is Not Null And (dbo_tbl.EntryDate) <
DateSerial(Year([EntryDate]), Month([EntryDate] + 1, 1))

                 John W. Vinson[MVP]    
 
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



©2008 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.