count2 trouble

This forum is a self-help system for the exchange of ideas among AppleWorks users.

count2 trouble

Postby dnabag » Thu May 26, 2005 12:47 am

The following delivers, as i wish, a summary count of all items received on Monday (and every other day):

FieldName - FieldFormula - FieldType

Date - (Date)
day - WEEKDAY('Date') - Calculation
dayname - DAYNAME('day') - Calculation
mondays - COUNT2("Monday",'dayname') - Summary


However, I cannot seem to get a summary count of items based upon the hour received using the following:

FieldName - FieldFormula - FieldType

Received Time (Time)
time - HOUR('Received Time') - Calculation
hour - COUNT2("23",'Received Time') - Summary

There are several hundred records for each hour (ie 0, 1, 2...22, 23) but 0 is the number returned in the summary.

I'm clearly missing something, can someone offer a solution?

Thanks.
dnabag
 

Re: count2 trouble

Postby haumann » Thu May 26, 2005 12:15 pm

dnabag wrote:The following delivers, as i wish, a summary count of all items received on Monday (and every other day):

FieldName - FieldFormula - FieldType

Date - (Date)
day - WEEKDAY('Date') - Calculation
dayname - DAYNAME('day') - Calculation
mondays - COUNT2("Monday",'dayname') - Summary


However, I cannot seem to get a summary count of items based upon the hour received using the following:

FieldName - FieldFormula - FieldType

Received Time (Time)
time - HOUR('Received Time') - Calculation
hour - COUNT2("23",'Received Time') - Summary

There are several hundred records for each hour (ie 0, 1, 2...22, 23) but 0 is the number returned in the summary.

I'm clearly missing something, can someone offer a solution?

Thanks.

Your "time" calculation field is redundant and can be eliminated (unless you need it for some other purpose). Just change your "hour" formula to...

COUNT2(23,HOUR('Received Time'))

Note that there are no quotes around the "23" (excuse the irony in the notation here).

John@was
haumann
 
Posts: 961
Joined: Sun Aug 25, 2002 8:16 pm
Location: San Antonio

Re: count2 trouble

Postby dnabag » Thu May 26, 2005 7:46 pm

haumann wrote:
dnabag wrote:The following delivers, as i wish, a summary count of all items received on Monday (and every other day):

FieldName - FieldFormula - FieldType

Date - (Date)
day - WEEKDAY('Date') - Calculation
dayname - DAYNAME('day') - Calculation
mondays - COUNT2("Monday",'dayname') - Summary


However, I cannot seem to get a summary count of items based upon the hour received using the following:

FieldName - FieldFormula - FieldType

Received Time (Time)
time - HOUR('Received Time') - Calculation
hour - COUNT2("23",'Received Time') - Summary

There are several hundred records for each hour (ie 0, 1, 2...22, 23) but 0 is the number returned in the summary.

I'm clearly missing something, can someone offer a solution?

Thanks.

Your "time" calculation field is redundant and can be eliminated (unless you need it for some other purpose). Just change your "hour" formula to...

COUNT2(23,HOUR('Received Time'))

Note that there are no quotes around the "23" (excuse the irony in the notation here).

John@was


Hello, and thank you John!

Turns out that I mistyped the last summary field, it should have read "hour - COUNT2("23",'time') - Summary", which would explain the need for the 'time' calculation.

Whne trying your fix I still got '0' as the result, but when I removed the quotes from my summary field it works perfectly. So it seems to have been a matter of the quotes. Not certain why that's the case, but I'm happy with the result!

I'll be joining AWUG as a paying member to support all the help you all seem to offer!

Thanks again!
dnabag
 

Re: count2 trouble

Postby haumann » Thu May 26, 2005 8:44 pm

dnabag wrote:Turns out that I mistyped the last summary field, it should have read "hour - COUNT2("23",'time') - Summary", which would explain the need for the 'time' calculation.

Whne trying your fix I still got '0' as the result, but when I removed the quotes from my summary field it works perfectly. So it seems to have been a matter of the quotes. Not certain why that's the case, but I'm happy with the result!


You couldn't match because the quotes around the "23" made it a literal string, while your calculated 'time' value was a numeric, making a match impossible. Be removing the quotes, you are now comparing a numeric against another numeric, making a match possible.

John@was
haumann
 
Posts: 961
Joined: Sun Aug 25, 2002 8:16 pm
Location: San Antonio

Re: count2 trouble

Postby dnabag » Sat May 28, 2005 2:08 am

haumann wrote:You couldn't match because the quotes around the "23" made it a literal string, while your calculated 'time' value was a numeric, making a match impossible. Be removing the quotes, you are now comparing a numeric against another numeric, making a match possible.

John@was


Thanks for the explanation. It actually corrected a problem I was having in another calculation.

Keep up the great support!
dnabag
 
Posts: 7
Joined: Sat May 28, 2005 2:04 am
Location: San Diego


Return to AppleWorks Help

AppleWorks Users Group Logo iWork Users Group Logo