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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count # of dates question

Status
Not open for further replies.

vshapiro

Programmer
Jan 2, 2003
211
US
It looks like easy thing but I cannot find the way to do it.
My table have the following columns:

Project#
Draft_Date
End_date
Exit_date.... etc

I need to count Draft_Date(or Exit_date or End_date) where Draft_date is not null and Distinct Project#.
I am doing the formula

if isnull({V_AUDIT_QUALITY.DRAFT_DATE}) then 0 else 1
and then Sum formula. But it could be duplicate project# so I need to make sure that I have distinct Project#.

How can I do this??
 
Why don't you group by Project#, and create a running total or summary operation based on Count({Draft_Date},{Project#})?

Naith
 
I grouped by Project# then have a formula
if isnull({V_AUDIT_QUALITY.DRAFT_DATE}) then 0 else 1
and then Sum it. But it Sum all the projects not only distinct ones. Am I missing something?
 
Move your formula into the Group header so that it only evaluates once per Project#.

~Brian
 
Thanks. I got it.
Now I have another question.
It is calculating OK but I want to display all Project numbers and all draft_dates. I need to display Project# only if draft_date is not null but I display all the project numbers and nulls if draft_date is null..??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top