Skip to Content
author's profile photo
Former Member

Estimating Delivery Time

I am trying to run a formatted search to display a simple estimated delivery time for each line item in my sales order. My query is as follows:

SELECT (CASE

WHEN (T0.OnHand - T0.IsCommitted) > 0

THEN (DocDate + T0.LeadTime)

WHEN (T0.OnHand - T0.IsCommitted) <= 0

THEN (DocDate + 5 + T0.LeadTime)

END)

FROM OITM

WHERE T0.ItemCode = $[$38.1.0.0]

This query errors out, any ideas?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Oct 01, 2005 at 09:14 AM

    I guess you have to try SQL Date functions like

    SELECT dateadd(Day, 7, GetDate())

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_da-db_3vtw.asp

    HTH

    Juha

    Add comment
    10|10000 characters needed characters exceeded