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

Date Formula Needed for Distinct Count 1

Status
Not open for further replies.

dlazarus66

IS-IT--Management
Nov 26, 2007
6
US
Formula function: I am working with a manual crosstab. I need a formula to say, "if date = Monday", show me a distinct count of "x" just for Monday. I have various selections taking place so I'm unable to use //{@Monday}:
if dayofweek({Date}) = 2 then 1.

I need to take that day of Monday and do a Distinct count just for that day. I tried using the DistinctCount (f1,f2,s) and put Monday for the s, but it's rejected. I created a formula just for Monday then did "Distinctcount ({qryActionsLinkedToJobs.ActionJobPKID}, {@Monday})", but it gives me a count for the entire week, and not just Monday. Any help would be much appreciated.
 
Create a formula {@Null} by opening and saving a new formula without entering anything.

Then create a second formula:

if dayofweek({Date}) = 2 then
{qryActionsLinkedToJobs.ActionJobPKID} else
tonumber({@null})

If the actionjobpkid is a string, then omit the tonumber().

Place this formula in the detail section and then right click on it and insert a distinctcount on it at the group and/or report level.

-LB
 
This works perfectly!!! You're the best and thanks much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top