A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Putting mult query to one to make report



 
 
Thread Tools Display Modes
  #1  
Old October 1st, 2004, 05:25 PM
Peter L
external usenet poster
 
Posts: n/a
Default Putting mult query to one to make report

I needed to make a report that shows how many records took how long to
complete so in the table there is a request date and a complete date and so I
have a query set up to tell the date difference between them and then if it
is 1 it will list it etc ten queries like that for records that took 1 day
then 2 day etc, then I was trying to make a query that pulled all those
queries and counted the amount of records in each query so there would be 10
fields to display the amount of record that took x amount of days, but that
query doesn't work right it will only pull the info if the amount of records
in each of the 10 query is the same then it will display 1 for all of them
but if any are different it won't pull that, can anyone give me a hand?
  #2  
Old October 2nd, 2004, 05:26 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

Use DateDiff() to get the difference between the two dates.
Group by this value, and get the count of the primary key field:

SELECT DateDiff("d",[RequestDate],[CompleteDate]) AS Days,
Count(Request.ID) AS CountOfID
FROM Request
GROUP BY DateDiff("d",[RequestDate],[CompleteDate]);

Once you have that working, you can use that query as an input "table" for a
crosstab query if you wish to have the Days as column headings.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter L" Peter wrote in message
...
I needed to make a report that shows how many records took how long to
complete so in the table there is a request date and a complete date and
so I
have a query set up to tell the date difference between them and then if
it
is 1 it will list it etc ten queries like that for records that took 1 day
then 2 day etc, then I was trying to make a query that pulled all those
queries and counted the amount of records in each query so there would be
10
fields to display the amount of record that took x amount of days, but
that
query doesn't work right it will only pull the info if the amount of
records
in each of the 10 query is the same then it will display 1 for all of them
but if any are different it won't pull that, can anyone give me a hand?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Report based on crosstab query - problem printing Malcolm P Setting Up & Running Reports 5 October 1st, 2004 09:42 PM
Report based on crosstab query - problem printing Malcolm P General Discussion 2 September 27th, 2004 03:53 PM
Report Based Upon Parameter Query with Form References Vincent DeLuca Setting Up & Running Reports 4 July 19th, 2004 01:55 AM
Label SRIT General Discussion 2 June 22nd, 2004 09:42 PM


All times are GMT +1. The time now is 07:46 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.