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

Multiple criteria formula errors

Status
Not open for further replies.

NGonz

Technical User
May 12, 2001
13
US
Hi all,

I was hoping to get some assistance for a formula problem I'm having. I want to use this formula in a running total but just am playing with it in a formula to try to get it to work.

Termdate is a sting field that tells what date a change was made (was originally termination date but this field has changed defintion somewhat to detail when a status has been changed). @Last_m_yr gives gives last month's date and is a date field. @Prior2_m_yr gives the date from 2 months ago and is also a date field.

I'm basically looking for a change in the status that has occured in the past month only which doesn't seem to be a problem. The problem occurs when I put in the {users.STATUS} = "H" statement. I'm looking for this change in Hourly paid employees. But when I add that statement the formula returns "False" everytime.

if {users.termdate} <> &quot; &quot; then
if DTSToDate({users.term_date}) < ({@Last_m_yr}) AND
DTSToDate({users.term_date}) > ({@Prior2_m_yr}) AND
//AND {users.STATUS} = &quot;H&quot;
then &quot;True&quot; else &quot;False&quot;
else &quot;0&quot;

I do this calculating in the Group Footer #2 and I these fields into the Details (which I normally suppress for this report) and it looks like it should be working but it tain't happenin'. The first line and last line can almost be ignored since I'm just checking to make sure termdate has an actual value.

I'm not sure what I'm missing since I'm pretty sure I have done formulas and running totals that validate against more than one field. Any comments/suggestions will be appreciated.

Regards,
NGonz


 
What are the formulas used in Last and Prior? Are they running totals?
That &quot;H&quot; line changes a TRUE to a FALSE?
And a formula that just says:

{users.STATUS} = &quot;H&quot;

Comes up TRUE in the same spot? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

Thanks for your help. I found my mistake. Instead of {users.STATUS} = &quot;H&quot; I need to use {users.paytype} instead. I guess that's one error that the 'check formula' option won't catch (Duh). Sorry for taking up your valuable time.

Thanks again for your timely response,
NGonz
 
Ken,

Thanks for your help. I found my mistake. Instead of {users.STATUS} = &quot;H&quot; I need to use {users.paytype} instead. I guess that's one error that the 'check formula' option won't catch (Duh). Sorry for taking up your valuable time.

Thanks again for your timely response,
NGonz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top