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

Increment count to a variable 1

Status
Not open for further replies.

artchi

IS-IT--Management
May 28, 2003
1
US
Help please, I would like the total instance a person login from a date range. The value will be used to compute the average a person login from this date range. How can I do this?
 
You can use the datediff function to learn the difference bewteen 2 date or datetime fields if that's what you want:

datediff("s", {table.date1}, {table.date2})

You might want to supply example data and expected output rather than try to describe it with words alone.

-k
 
Something like this might work. In your record selection, you would select the time period under consideration, and you might want to create a date parameter, e.g.,

{table.logindate} in {?date} to {?date}+30

Then group on {table.personID}, and insert a summary (count) on the {table.logindate}. You can use the datediff function to determine the total number of days during the time period you used in your selection formula, and incorporate it into a formula like the following to get the average number of logins during the time period {@avelogins}:

count({table.logindate},{table.personID})/datediff("d",{?date},{?date}+30) //place this formula in the group header or footer

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top