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

Stop Calculation field going to a negative value i.e. -16

Status
Not open for further replies.

mharkin

Technical User
May 9, 2012
16
GB
Hi

I have a calculation field with the below calculation, the problem i have is that the field goes to a negative value, I want it to stop at 0.

Can someone please help me with this,

any help would be very much appreciated.

Thanks
Mark
 
apologies here is the calculation:


Int((Date()-Contact2->UDCAABSDTE)*0.08/365*Contact2->UDCAABAMOU)+(Contact2->UDCAABAMOU)-(Contact2->UPAIDCLT+Contact2->UPAID2SGP+Contact2->UDCAPAYJUD)
 
You might have to use the iif() function. Something on the order of:

iif((Int((Date()-Contact2->UDCAABSDTE)*0.08/365*Contact2->UDCAABAMOU)+(Contact2->UDCAABAMOU)-(Contact2->UPAIDCLT+Contact2->UPAID2SGP+Contact2->UDCAPAYJUD))>0, 0, Int((Date()-Contact2->UDCAABSDTE)*0.08/365*Contact2->UDCAABAMOU)+(Contact2->UDCAABAMOU)-(Contact2->UPAIDCLT+Contact2->UPAID2SGP+Contact2->UDCAPAYJUD))

DJ Hunt
Phone: (978)2-3333
WebSite:
- GoldMine Premium - The Definitive Guide
- One-on-One GoldMine Technical Support ( Fee Based )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top