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

Formula in Crystal 3

Status
Not open for further replies.

blairclw

Technical User
Mar 1, 2005
38
US
I have a formula that pulls in years of service and it works and looks like this:
Datediff ("yyyy", {EmployeePos_Stat_Curr.LastHireDate}, CurrentDate)

I would like to only see those that have with 1 or more years of service, not anyone less. How would I write that??
 

In selection formula...

Code:
Datediff ("d", {EmployeePos_Stat_Curr.LastHireDate}, CurrentDate) >= 365
 
It shows me true or False....how do I see the actual number?
 
What I'm trying to do is find the years of service but I want it to tell me the exact amount of service. So if they have only been here for say 8 months I don't want it to print a 1. I want to see the exact months so I can remove those from my list.
 
The formula from jjames above goes in you record selection formula. It will only select records where the date difference is >= 365 days. This will eliminate records less than one year.
MrBill
 
What you've got is a boolian, a test without an 'if' and which returns true or false.

If the name was @FindYear, you could test it as @FindYear = true, or just as @FindYear, and as not @FindYear if you want those that don't have the condition.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top