Skip to main content
Answer

Generic Inquiry Row Style

  • April 26, 2024
  • 4 replies
  • 146 views

Forum|alt.badge.img+1

We would like to add a row style to a Generic Inquiry where if the SOOrder.OrderDate within 3 days of shipping AND SOShipment.ShipDate <= 3 days from the SOOrderDate show the row as ‘green40’ else show as ‘red40’. Unfortunately using Is Between can’t be used for the row style.

Best answer by lauraj46

Hi @wmatthews1877 ,

Instead of ‘between’ you can just specify both conditions and combine with the ‘and’ operator, something like this:

=iif(datediff(‘d’, [SOOrder.OrderDate],[SOShipment.Shipdate])>=-3 and datediff(‘d’,[SOOrderDate],[SOShipment.Shipdate])<=3, ‘green40’,’red40’)

Hope this helps!

Laura

4 replies

lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • Answer
  • April 26, 2024

Hi @wmatthews1877 ,

Instead of ‘between’ you can just specify both conditions and combine with the ‘and’ operator, something like this:

=iif(datediff(‘d’, [SOOrder.OrderDate],[SOShipment.Shipdate])>=-3 and datediff(‘d’,[SOOrderDate],[SOShipment.Shipdate])<=3, ‘green40’,’red40’)

Hope this helps!

Laura


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • April 26, 2024

So far, so good. Thank you.


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • April 29, 2024

Thank you for your response, but now it gets a little more complicated. Here is the code

as we have it,

=iif(datediff(‘d’, [SOOrder.OrderDate],[SOShipment.Shipdate])>=-3 and datediff(‘d’,[SOOrderDate],[SOShipment.Shipdate])<=3, ‘green40’,’red40’)

and the added complication is if the SOShipment.ShipDate is < than the SOOrder.RequestDate. There are some instances where the SOOrder.RequestDate is in May, but the SOShipment.ShipDate is on the 29th of this month. If that has happened, then technically it should still be green, and not red.


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • April 29, 2024

Hi @wmatthews1877 ,

You can combine whatever criteria you like in the condition statement, just be careful with the parentheses for order of operations.  Something like this may do it:

=iif((datediff(‘d’, [SOOrder.OrderDate],[SOShipment.Shipdate])>=-3 and datediff(‘d’,[SOOrderDate],[SOShipment.Shipdate])<=3) or [SOShipment.ShipDate]<[SOOrder.Requestdate]), ‘green40’,’red40’)

Hope this helps!

Laura