Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 24th, 2006, 11:15 AM
z.ghulam@gmail.com
Guest
 
Posts: n/a
Default Problem with Totals / Sum / Count ??

Hi,

I've been trying to work this little problem out for a while, but to no
avail. I'll start with an example as I've asked before, but not sure if
it was very clear what I'm trying to do.
I have a query which produces the following

Order Type Total Date
Eth 2 09/01
LL 39 09/01
LL 8 10/01
LL 15 11/01
DSL 1 10/01

The Total is based on a COUNT expression which counts the number of
order types in a day.
The date range is pre-selected by the user.

What I would like is for the query to add the totals of the same order
within the date range so I get:

Order Type Total
Eth 2
LL 62
DSL 1

I have a couple of reports which need this tweaking - I'd appreciate
any feedback . help anyone has to offer.
Cheers

  #2  
Old January 24th, 2006, 12:55 PM
z.ghulam@gmail.com
Guest
 
Posts: n/a
Default Re: Problem with Totals / Sum / Count ??

This is the SQL I currently have to produce the example above:

SELECT [Order Type (For Combo)].[Order Type], Count(*) AS Total, [Order
Link].[Allocation Date]
FROM [Order Type (For Combo)] INNER JOIN [Order Link] ON [Order Type
(For Combo)].[Order Type ID] = [Order Link].[Order Type ID]
GROUP BY [Order Type (For Combo)].[Order Type], [Order
Link].[Allocation Date], [Order Link].[Order Type ID]
HAVING ((([Order Link].[Allocation Date]) Between [Forms]![Calender
Test]![BeginningDate] And [Forms]![Calender Test]![EndingDate]));

  #3  
Old January 24th, 2006, 01:05 PM
Wayne Gillespie
Guest
 
Posts: n/a
Default Re: Problem with Totals / Sum / Count ??

On 24 Jan 2006 03:07:07 -0800, z.ghulam@gmail.com wrote:
[color=blue]
>Hi,
>
>I've been trying to work this little problem out for a while, but to no
>avail. I'll start with an example as I've asked before, but not sure if
>it was very clear what I'm trying to do.
>I have a query which produces the following
>
>Order Type Total Date
>Eth 2 09/01
>LL 39 09/01
>LL 8 10/01
>LL 15 11/01
>DSL 1 10/01
>
>The Total is based on a COUNT expression which counts the number of
>order types in a day.
>The date range is pre-selected by the user.
>
>What I would like is for the query to add the totals of the same order
>within the date range so I get:
>
>Order Type Total
>Eth 2
>LL 62
>DSL 1
>
>I have a couple of reports which need this tweaking - I'd appreciate
>any feedback . help anyone has to offer.
>Cheers[/color]

If the Date field is only being used to set the date range, in the query design change the Date column from Group By to
Where.


Wayne Gillespie
Gosford NSW Australia
  #4  
Old January 25th, 2006, 10:05 AM
z.ghulam@gmail.com
Guest
 
Posts: n/a
Default Re: Problem with Totals / Sum / Count ??

Cheers Wayne,

Thats sorted the problem on all my reports out very nicely.
Many Thanks

 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles