Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct Count

Status
Not open for further replies.

tkaz

Technical User
Feb 21, 2005
75
US
I am using CR 11 and SQL Server 2005 DB.

I am working on a report that looks at today, yesterday, WTD, MTD, YTD, and TODate volumes by plant. On today's date, I need to count the number of loads shipped.

Seemed simple enough to say if RUNDATE = CurrentDate then RTTicket.ID, slap into the details and do a distinct count for two groups: product and plant.

It works, but is counting the null as a distinct because the date criteria is in the period YeartoDate.

Does anyone have a suggestion?



 
Create a formula {@null} by opening and saving a new formula without entering anything. Then change your formulas to add the {@null} default as in:

if RUNDATE = CurrentDate then
{RTTicket.ID} else
tonumber({@null})

If the ID field is a string, remove the tonumber().

-LB

 
Thank you so much! It appears to have done the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top