# Calculate the Days Between Orders

• Comments posted to this topic are about the item Calculate the Days Between Orders

• Well nuts. Missed that one too. I stink.

"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt

• Grant Fritchey wrote:

Well nuts. Missed that one too. I stink.

Look at it this way, you're helping the rest of us deal with our imposter syndrome.

• Tom_Hogan wrote:

Grant Fritchey wrote:

Well nuts. Missed that one too. I stink.

Look at it this way, you're helping the rest of us deal with our imposter syndrome.

HA!

Yep. Just one of the many services I'm here to provide.

"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt

• I was expecting the LEAD solution to need the UNBOUNDED FOLLOWING frame, so I discounted that one.

• LAG and LEAD do not use the frame. They are simple to use and perform great!!

• I do have one complaint:

By using ORDER BY OrderID, I'm making the assumption that the primary key (which is implied to be an IDENTITY column) ascends sequentially with OrderDate.

This could break if (more like, when) someone retroactively adds a back-dated order.

I would have used OVER(PARTITION BY CustomerID ORDER BY OrderDate))  to safeguard against that possibility.

• Slightly-OT: I think the discussion link for the 2020-02-11 QotD ("Execution Plan Types") is wrong, it currently points to this editorial. Could someone please fix that?

• Wolfram Kraus wrote:

Slightly-OT: I think the discussion link for the 2020-02-11 QotD ("Execution Plan Types") is wrong, it currently points to this editorial. Could someone please fix that?

I didn't "fix it", but it seemed to work right when I tried it just now.

"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt

• Nope, sorry, still not working. I'm speaking about "Join the discussion and add your comment" link at the end of the answered page. This also happened last week with https://www.sqlservercentral.com/questions/xact_state-trancount-and-rollback, the same situation. That link points to https://www.sqlservercentral.com/?post_type=topic&p=3715328 which is for me redirected to the same editorial. Tried with a different browser, still the same.

• Wolfram Kraus wrote:

Nope, sorry, still not working. I'm speaking about "Join the discussion and add your comment" link at the end of the answered page. This also happened last week with https://www.sqlservercentral.com/questions/xact_state-trancount-and-rollback, the same situation. That link points to https://www.sqlservercentral.com/?post_type=topic&p=3715328 which is for me redirected to the same editorial. Tried with a different browser, still the same.

I've got nothing. I just tried it. It not only worked, I left a comment. I'll try some more.

"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt

• Wolfram Kraus wrote:

Nope, sorry, still not working. I'm speaking about "Join the discussion and add your comment" link at the end of the answered page. This also happened last week with https://www.sqlservercentral.com/questions/xact_state-trancount-and-rollback, the same situation. That link points to https://www.sqlservercentral.com/?post_type=topic&p=3715328 which is for me redirected to the same editorial. Tried with a different browser, still the same.

Oddly enough, that one from last week also lets me go to the right page. I'm not sure. I'll investigate a little.

"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt

• No need to worry, Grant. I just found it weird, this never happened before and now twice in a week. I'm not that great forum poster that I need that links 😉

Just FYI: Tried it now with FF, Chromium & Opera on Linux always the same behavior. Last week I tried with FF on Win10.

• We need to fix it because I suspect there will be a little bit of a brouhaha about the question & answer today.

"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt

• Seems legit.

If this is helpful: I head over to https://www.sqlservercentral.com/questions and the link at the end ("Join the discussion") points to https://www.sqlservercentral.com/?post_type=topic&p=3715247. If I click on the according link in the question list https://www.sqlservercentral.com/questions/execution-plan-types, I see the same link.

Viewing 15 posts - 1 through 15 (of 17 total)