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?

Actually, I think we get 1 row with a NULL value. My bet is that we have NULL in T0.LeadTime.
Try this:
SELECT (CASE
WHEN (T0.OnHand - T0.IsCommited) > 0
THEN dateadd(Day, COALESCE(T0.LeadTime,0), GetDate())
WHEN (T0.OnHand - T0.IsCommited) <= 0
THEN dateadd(Day, (5 + COALESCE(T0.LeadTime,0)), GetDate())
END)
FROM OITM T0
WHERE T0.ItemCode = $[$38.1.0.0]
If you want to read more about nulls then check this:
http://www.sqlservercentral.com/columnists/mcoles/fourrulesfornulls.asp
HTH
Juha

Similar Messages

  • Fedex estimated delivery time...

    What do you guys think about the estimated delivery time of fedex? Anybody received their iphones before the estimated delivery time? Mine says that its coming at 3 pm but I dont wana leave the house because the truck might come earlier.

    Don't leave the house! My eta was 4:30 P.M. and they came and 9:00 A.M. I didnt hear a knock or a bell. I'm so [Edited to comply with Terms of Service] Now I have to go pick it up 45 mins away. Ahhhhhh

  • Is the iPhone 4 current estimated delivery time of 3 weeks accurate?

    I just ordered mine 2 days ago, and my order is supposedly going to be sent off on Sept. 9 and I will receive my order on Sept. 14. Would you say this is quite accurate? or is it possible for it to arrive early, I heard of cases where it was received a week early.

    Char180 wrote:
    Where am I writing from you mean? California if that is what you are asking. I am hoping that delivery date is worse case scenario, I am the worst at waiting lol
    yes, I meant where are you writing from. My mind types faster than my fingers........The delivery date is usually the latest date you might receive your phone. Someone else commented it's only taking 3 days with AT&T. You could try ordering from AT&T and if you get your phone faster, cancel the order with Apple. Other's have walked into a Radio Shack, WalMart or even Best Buy and managed to get one on the spot. It might be worth trying that if you want your phone sooner. Good luck......

  • Current Delivery times on 27 inch iMacs through David Jones

    Hi All
    I am new here and just wanted to ask a question.
    I ordered an iMac 27inch (the standard configuration) though David Jones Last month (mid month). They advised of a 2 week waiting time. I rang today and was told they have no estimated delivery time at the moment.
    I am just wondering if any one else knows of the delivery time to resellers (DJ'S). I did request an order number so I could track it with Apple, but was told because it was a standard configuration, they didn't have a tracking number?
    I have read previous posts from last year with terrible stories about delivery times, but thought these issues had been resolved?
    Cheers
    Kathy..

    I think I got a little ahead of myself explaining my problem, so let me clarify...
    Only the one iMac is having the network file deletion problem, but it is included in the network user logon problem.  So 4 out of 5 of the iMacs have had or are having logon problems with network users accounts using mobile accounts on the systems.  2 of the 4 I have wiped and started over on and the other 2 have different network accounts being used by the primary system users.  The 5th iMac has not caused any problems except I forgot to mention that the USB on it seems flaky.
    So we are apparently full of problems. 

  • Is the estimated delivery on time?

    i want to buy an iphone 6, im from argentina, but i want to buy an iphone in new zealand and i dont have a lot time to wait the delivery. The estimated delivery is on time?

    You can't buy an Apple device from Apple from another country; it does not ship internationally. The time of delivery depends on how you get it from NZ to Arg (whether you get a friend there to send it to you by regular mail or other).
    Be careful if you buy a phone from abroad, as some iPhone models are country or continent specific, and certain LTE or 3G bands do not work in your country.

  • Apple Delivery Times

    I was just curious as to how Apple is with their estimated delivery date vs the actual delivery date? I ordered a CTO 15" MPB on Saturday. Apple sent me an e-mail saying it should ship out on the 22nd and, with the 2-3 business day delivery, be here by the 27th. Are they usually a little faster then they give themselves credit for? Thanks.

    Apple's initial estimation is usually longer than it will actually take. They typically put highest likely ship time, but it usually ships a day or two sooner (especially if it is a stock notebook). Once it is in FedEx's hands, the estimation tends to be spot on.

  • Delivery times on iPhone 6

    I recently ordered a iPhone 6 plus 128 on the 13/09/2014 the web site is quoting me 3 to 4 weeks, a friend of mine ordered his phone on the 12th when orderimg first opened, he's been quotated a similar time frame. do you think I'll be given a more realistic delivery time when apple opens it's doors to its shops tomorrow?
    If ive got to  wait of 3 - 4 weeks so be it - however it would be fantastic to think Apple already have my order sitting on a shelf in the UK and it's ready to ship?

    What color did you order?
    It appears the iPhone 6 Plus 128GB and 64GB in Gold are the most favored and ran out of stock the quickest.
    I ordered my (iPhone 6 Plus Space Gray 64GB) on 9-12-14 at 4 A.M. and my estimated shipping date is Oct 1 - Oct 6th. I check the status constantly and it still says its "processing items" and no shipping updates yet.
    Apple Support said they are expediting all iPhone pre orders to get the orders filled as quickly as possible.

  • Delivery times for iwatch

    I Have recently ordered a new iwatch on 12/04/2015 obviously I wasn't expecting delivery on the 24/04/2025 but was a little shocked that delivery is now estimated
    for the month of June. I then started to get buyers remorse and was contampating cancelling my order online - I've now changed my mind having visited an apple shop today successfully booking an appointment whilst in store meant only a five minute wait to try one on.
    It is absolutely brilliant and can't wait for mine to arrive.
    what do you think the chances are of my delivery time coming forward?

    As someone is sure to point out, we are all users like yourself - not Apple employees - so it is just guesses on our parts. However I have recently read several articles that implied (either through their own guesswork or actual sources in Apple) that a lot of those June delivery dates are probably going to be earlier than originally estimated.

  • IPod delivery times?

    I ordered a new iPod Touch, since my 4th Generation Touch is completely broken. This is the first time I've ordered an item from the Apple Store. I coughed up an extra 10 bucks to get the 2-3 day shipping--I got my name engraved into it, so that sets it back a day.
    I'm impatient by nature so I was curious if the estimated delivery dates were a worst-case-scenario type of deal or if the items usually arrive on-time/late vs. being early.
    Currently, the iPod is scheduled to arrive on (this) Tuesday, before 10:30 AM. I have several other packages coming in throughout the week (gotta love refund season) but I can hardly wait for this one.
    Is there anyone who has experienced early arrival? Or should I expect it to arrive well..when it's expected to?
    Thanks!

    My experience is that they allways arrive when specified. Also, sometimes they arrive earlier that when specified when I initially ordered an item. Since it appears that you are using the deliverer;s tracking (FedEx, UPS) it will arrive when they specified. The only concern would be:
    - an accident
    - Or if you are in the Northeast USA the snow may yet delay it.

  • Question regarding over ONE MONTH delivery time?

    Hello all,
    I am aware of the W-Series shipping thread, but it hasn't been updated in some time so I wasn't sure it was still active. Others complained there of long and inaccurate delivery times, but others had the inverse experience - so I thought I would ask anyway.
    I purchased a W520 online earlier today, but checking my order status tonight reports that the laptop itself is scheduled for a ship date of the first of May. Assuming I allow only a week for the delivery to actually arrive, it means I'm waiting over a month for my purchase to arrive. This seems like a very long time!
    When I purchased the laptop, the site reported an estimated ship date of April 17th. Ten days until the hardware ships is resonable for this type of purchase. A thirty day wait is not (especially when there was no warning of backorder or delay when I made the purchase). Had I known upfront the estimated delay would be so bad, I never would have made the purchase. Now I understand that the delivery date provided during purchase is an estimate, and in no way a guarantee, but the delta between the two dates has me concerned. It took quite a bit of research for me to get over the purported SSS issue, and that buying a Lenovo was still a smart move - but once again I'm starting to worry.
    My hope is that the estimated ship date listed under my Order Status will change to a date that is closer to the date given during the purchase, and that I won't be waiting a moon cycle to get my new W520. The purchase was made less than twenty-four hours ago, and although Lenovo said it will only take six hours for my Order Status to populate, I'm hoping this is simply a calculation error. Why I am truly worried and am bothering to post this question, however, is that other items I purchased in the same order DO have realistic ship and delivery dates. I ordered a sleeve to accompany my W520, and my Order Status is already reporting that it will ship 4/8 and be delivered 4/13. If this is accurate, and it does seem plausible, it makes it more likely my W520 estimated ship date is also accurate. And that is basically unacceptable.
    Has anyone recently purchased/received a W520, and if so how long was the delivery delay? Am I (hopefully) correct in assuming the May first ship date is simply an early calculation by the Order Status page and will be updated to reflect a more realistic ship/delivery date? Has anyone else experienced an issue with early estimates of ship date on their Order Status being inaccurate and abnormally long?
    My specs are i7-2640M, 15.6" FHD (1920x1080), Quadro 2000M, 8 GB RAM, 320GB Hard Disk Drive (7200rpm). Everything else was stock.
    Thanks in advance for any insight or help. Here is to hoping I won't have to cancel this order because of what should be an easily avoidable issue.
    ~G

    We don't see many users showing up here in the forum with new W520 machines right now, which may indicate sales are slow, which naturally makes you wonder why the wait is so long to ship new W520 orders. But someone just caught a store in the Netherlands accidentally featuring the new Lenovo Ivy Bridge/Kepler laptops (also see here) in their online store for sale.
    So if the detailed ordering info for the new machines is at the retailer level right now, then Lenovo will likely announce the new laptops on or just after April 29, when Intel is expected to officially release the new Ivy Bridge processors. And it also means Lenovo has probably diverted much of its current production resources to building the new machines for the release.
    That may explain the W520 shipping delays, although it's certainly a pain in the rear for anyone who wants to buy one of the current models, before they go out of stock. Anyway, a little buzz is always entertaining--that's certainly what makes the Apple world go round (the Apple forums are rife with about 150 pages of Ivy Bridge buzz, vs. almost nothing here in the W-series forum, so this forum may be asleep).
    I'm dying to see test results of Nvidia's killer GTX 680M Kepler-based mobile graphics processor (and workstation sibling) when it finally comes out, although that may take a bit longer (and may only ship in 17" machines). But it should have roughly 3.4 times the performance of the Quadro 2000M.

  • Estimated delivery date for my iPad 2 has passed. What are current delivery estimates?

    I am sure there was a surge in orders on Black Friday, but the estimated delivery was listed as 12-6 and my order is still processing. I called support and they did not see anything wrong with my order. How long should I expect to wait?

    I think that you mean that you cannot reset all settings or erase the device using the settings because of the fact that you don't remember the passcode. Unfortunately, you can't retrieve a restrictions passcode. You have to restore the iPad to factory settings to remove the passcode. However, that is something else that I suggested in my post above. And frankly, not knowing your restrictions passcode makes using the iPad such a pain be use you need to get into the settings from time to them.
    You will have to restore completely as new and not use a backup. If you backup and restore the backup, you will be restoring the passcode that you cannot  remember.
    Use iTunes to restore your iOS device to factory settings

  • MRP - Auto creation of del schedule lines based on planned delivery time

    Hi,
    We have activated MRP (type PD) where Purchase requiesition is auto created by system for requirement quantity. We require to optimize delivery schedule in such a way that entire PR quantity is broken into various delivery schedule based on planned delivery time and requirement.  Scenario can be further explained with following example.
    Material Requirement for a month is say 1,25,000 units
    Closing Stock say 25,000 units
    PR Generated by system for 1,00,000 units. The entire quantity is schdulled with only one delivery schedule line as per planned delivery time. 
    The requirement is to generate multiple delivery schedule lines automatically in Purchase requisition based on planned delivery time so that Purchase orders can be placed with system generated delivery schedule lines.
    How can it be achieved ?
    Regards,
    Nirav Kinkhabwala

    Nirav,
    This subject has been discussed repeatedly in this and other forums.  I must assume that you overlooked the rules of engagement, which state that you should first search the forums and other public sites, before posting questions here.
    Standard SAP MRP cannot be made to generate multiple items in a Purchase requisition.  The functionality you seek is usually achieved when converting purchase reqs to Purchase orders, where many single purchase reqs can be adopted into a single Purchase order.
    You also might want to investigate use of Vendor Scheduling agreements.
    Best Regards,
    DB49

  • Standard  report(for open PO order items) with estimated Delivery dates

    hi friends
    i would like to know if there is any standard  report(for open PO order items) with estimated Delivery dates on it.
    thanks
    alahari

    ME2M (by material)
    ME2L (by vendor)
    ME2N (by number)
    Use selection parameter WE101 for open GR
    and scope of list EINT (scheduling lines)

  • Delivery time in sale order

    Dear Sap Gurus,
    I had created a sale order with reference to a quotation.
    In the quotation-there are 2 line items with different delivery time.
    sale order date is 15/2/2008
    for eg line item 1  is 3 days
    line item 2 is 1 week
    the maximum delivery time is for line item 1 is 3 days
    so 15+3=18/2/2008.
    the system allows me to do the delivery,and pgi  even on 29/2/08.
    so the delivery time is not effective here.
    kindly suggest me what is the exact usage of this delivery time in a sales document.
    Points will be rewarded

    The Delivery date in the sales order is the Earliest date proposed by the system after automatic availability checks and delivery scheduling.
    The system uses the delivery date for each schedule line together with predefined time estimates for delivery activities (such as picking and packing) to determine the
    Material availability date
    Loading date
    Goods issue date
    Transportation planning date
    In ur case, ur order contains two item with different delivery dates of 15th and 28th.
    Suppose if u deliver the order on 15th , the delivery split takes and only one item will copied into the delivey.
    But if u deliver the order at 28th, both the items will be copied to the delivery, since both have already confirmed on the date
    Hope u understand...

  • Planned delivery time in Scheduling agreement and MRP

    Hello,
    Do you know is it possible to determine system so that MRP run will consider the planned delivery time from the scheduling agreement line instead of material master? Now the system read planned delivery time from material master when creating schedule lines automatically by MRP-run.
    Regards, jaana

    This can be customized in
    SAP Customizing Implementation Guide
    -> Production
    --> Material Requirements Planning
    ---> Planning
    > Procurement Proposals
    > Define External Procurement
    Here you can select the indicator "Scheduling according to purchasing info record or agreement" either at plant or MRP group level.

Maybe you are looking for

  • HP Z620 does not boot when external Seagate hard drive is connected

    I'm troubleshooting an HP Z620 workstation with 32GB RAM, one 500GB HDD + one 1TB HDD running Win 7 Enterprise 64 bits, this user has 2 external USB 3.0 HDDs,  one Buffalo 2TB  + one Seagate Desktop Backup Plus 4TB; the problem comes when the externa

  • Multiple column in LOV

    Dear community, I have been struggling with the issue that Apex wont allow me to display more than 1 value/column in a LOV/select-list. Is there a fix or workaround for that? I have been searching all over the internet, landed on a webpage with jQuer

  • DD_DOMA_GET not remote enabled but system is 4.7

    Backend system is 4.7 that i try to connect from web dynPro project (portal)..It gives error say that "RFC_ERROR_SYSTEM_FAILURE: The function module "DD_DOMA_GET" not released for 'remote' calls." I have searched forum beceuse of the function is not

  • Inserting a page

    how do i insert a pdf file in between every page of a pdf or word file; i have pdf pack.

  • Photo album layout...

    I dont use iPhoto to import pictures into the photo albums bc i first compress them, so basically I go to finder, look for my folder with the pics, and drag the pics i want (and drop them into the iweb window)/ My problem is that all of the appear ho