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!

Comparing two Status

Status
Not open for further replies.

wangui1981

IS-IT--Management
May 9, 2008
72
KE
I have a report showing orders that have been delivered.However in one order i have one item that has been delivered and another that is yet to be delivered.I need to show that if an order contains both delivered and undelivered itens then the status of that order should be Undelivered else if all items in the order have been delivered then the status of the order is delivered.
How do I write this formula?
 
Use a formula

@status

If (statusfield} = 'undelivered' then 1 else 0

Then in Order group footer, use formula

@orderStatus
If sum({@Status}, OrderNoGroupField) >0 then 'Undelivered'
else 'Delivered'

Ian
 
Thanks Ian that worked.
Now there is this other situation where i get the difference between the date of order and delivery in days.How can I write a formula showing if the goods have not been delivered then the delivery date is blank hence the status is "Undelivered" else show the difference between order date and delivery date.Iam already able to get the difference in dates.
 
@DeliveryDate

If isnull{DeliverDate} then 0
else
datediff("d", {orderdate}, {Deliverdate})

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top