Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Argh: Counting employees between a period of time

want to count the number of Employees (by counting their IDs) only for those records where the contents of the START_DATE field is greater than or equal to a date value in the variable vStartPeriod.

It shouldn't be the hardest problem in the world, but for the life of me, I can't get QV to return anything other than a zero. 

Here's the most recent thing that didn't work:

=count({<START_DATE={$(>=vStartPeriod)}>} EMPLOYEE_NUMBER)

 

Other variations that didn't work include...

=count({<START_DATE={$(">=" & vStartPeriod)}>} EMPLOYEE_NUMBER)

and about 20 other similar variations with teensy weensy differences.

To top it off, for some reason QV has started always saying my expression is "OK", even when it's clearly not.

Maybe it just got tired of complaining. Maybe that's QV's way of saying, "Yes, dear".

In any case, what the heck am I missing here?

Thanks

1 Solution

Accepted Solutions
marcus_sommer

It should be more look like:

=count({<START_DATE={">=$(=vStartPeriod)"}>} EMPLOYEE_NUMBER) or

=count({<START_DATE={">=$(=$(vStartPeriod=)"}>} EMPLOYEE_NUMBER)

and the format from the variable must be excactly the same like this from field.

- Marcus

View solution in original post

3 Replies
marcus_sommer

It should be more look like:

=count({<START_DATE={">=$(=vStartPeriod)"}>} EMPLOYEE_NUMBER) or

=count({<START_DATE={">=$(=$(vStartPeriod=)"}>} EMPLOYEE_NUMBER)

and the format from the variable must be excactly the same like this from field.

- Marcus

sunny_talwar

May be this:

=Count({<START_DATE={"$(='>=' & vStartPeriod)"}>} EMPLOYEE_NUMBER)


Where this -> ='>=' & vStartPeriod in a text box should give you the period you are looking for in the same format as START_DATE

Not applicable
Author

The first one worked so I stopped there.

Thanks!