Problems with IIF()

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Harry_Jones_(Guest)
Posts: 9
Joined: Tue Oct 10, 2017 12:44 pm

Problems with IIF()

Post by Harry_Jones_(Guest) » Mon Oct 29, 2012 12:07 am

The following code works in both FoxPro and Infinity__and if the invoice was in 2008 shows the quantity shipped __if in any other year shows 0.____IIF(year(invdte)=2008,QTYSHP,0)____I would like to have a space " " show up on the report - much easier to look at - if there were no shipments of this item in the year 2008.____The following works in FoxPro but NOT in Infinity.____IIF(year(invdte)=2008, QTYSHP," ")____I don^t understand why it won^t work. Is my decrepit old mind missing something?__

User avatar
cstrasser
Posts: 155
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Problems with IIF()

Post by cstrasser » Tue Oct 30, 2012 12:12 am

The problem is that you can^t mix types in Infinity like you can with FoxPro. Infinity functions require that all returned values be consistent (all logical or character for instance).____You have a few choices:__1. On the report layout, you can edit the property of the formula to not show zeroes.__2. You can change QTYSHIP to return something else, like STR(QTYSHIP)__3. You can replace the 0 with BlankNum()____
Chris Strasser
Liveware Publishing, Inc.
Work bigger.

Harry_Jones_(Guest)
Posts: 9
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Problems with IIF()

Post by Harry_Jones_(Guest) » Tue Oct 30, 2012 11:08 pm

Thanks, It^s nice to see that it^s not me - just a limitation in R&R:)

Post Reply