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!

Simple Question 1

Status
Not open for further replies.

nayfeh

Programmer
Mar 13, 2002
163
CA
Hi,

I have a text box in a report that has the following formula: Int([QtyOrdered]/108)*108. I need this value to print only if this calculated value is greater than 0. How can I do this? It is in the DETAIL section of the report.

Thanks in advance!
TN
 
iif(Int([QtyOrdered]>0,[QtyOrdered],"")

You're dividing by the same number you're multiplying by, which won't do much.

Also, please read the thread I reference in my sig file. It would be helpful if you made your subject line more informative.

Jeremy ==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Unless you're trying to round the number to the nearest multiple of 108...

to not print if it's zero, try this:

iif (Int([QtyOrdered]/108)*108 = 0, "", Int([QtyOrdered]/108)*108)

By the way, if you're basing your report on a query, it might be easier to include the calculation in the query, e.g.

BatchCount:Int([QtyOrdered]/108)*108

iif ([BatchCount] = 0, "", [BatchCount])
 
Thanks Beetee, YOUR advice was helpful.

TN
 
Well, I have to agree with Jeremy that a meaningful subject line is useful.

Also, people are not doing this for fame or money, it's an altruistic endeavor (albeit there is *some* free advertising), therefore I don't regard backhanded criticism as correct behavior.
 
Again, thanks for your advice. Very much appreciated and I will try to provide more helpful subject lines in the future. And also direct my question to the right forum. You guys have been very helpful, it is frustrating at times when I can't find the answer since my own knowledge is very limited in programming....all the "tek-ies" have been great and very helpful. And I look forward to helping others in the future with the knowledge I've gained from all of you. I wish I could do it today :)

Thanks,
TN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top