Post: SQL Question! (It's probaly simple, I just suck)
11-06-2013, 08:35 PM #1
jakerad95
YT - WrapAroundGaming
(adsbygoogle = window.adsbygoogle || []).push({});
Hi, first thanks for helping Smile Second this is very simple. Here is the question:

11. Report the order ID, required date, shipped date of all orders that were shipped one or more days after the required date.

So far I have:
SELECT OrderID, RequiredDate, ShippedDate
FROM Orders
WHERE (ShippedDate>=1RequiredDate);

Results do pop up, but there are 803 and there are multiple instances that show the ship date occurred before the Required Date. What I need to do is refine the results to show which products are shipped 1 or more days after the required date. Any help would be appreciated.

I WILL REP+
(adsbygoogle = window.adsbygoogle || []).push({});
11-06-2013, 08:40 PM #2
webzy
Work hard get Better
Originally posted by jakerad95 View Post
Hi, first thanks for helping Smile Second this is very simple. Here is the question:

11. Report the order ID, required date, shipped date of all orders that were shipped one or more days after the required date.

So far I have:
SELECT OrderID, RequiredDate, ShippedDate
FROM Orders
WHERE (ShippedDate>=1RequiredDate);

Results do pop up, but there are 803 and there are multiple instances that show the ship date occurred before the Required Date. What I need to do is refine the results to show which products are shipped 1 or more days after the required date. Any help would be appreciated.

I WILL REP+


This might work as I have only had little experience with this type of stuff before.

[Today 11:39 PM] webzy : Jake you need to singleize the spread sheet of orders then calculate the dates basically a numerosy program would help you as its based highly on equations

The following user thanked webzy for this useful post:

jakerad95
11-06-2013, 09:16 PM #3
jakerad95
YT - WrapAroundGaming
Originally posted by webzy View Post
This might work as I have only had little experience with this type of stuff before.

[Today 11:39 PM] webzy : Jake you need to singleize the spread sheet of orders then calculate the dates basically a numerosy program would help you as its based highly on equations


Thanks, this helped me get the answer Smile
11-06-2013, 09:19 PM #4
webzy
Work hard get Better
Originally posted by jakerad95 View Post
Thanks, this helped me get the answer Smile


Glad to hear sorry have limited experience and knowledge about SQL but happy it helped if you ever need
help on something again don't hesitate to VM me or PM when I see it i'll do me best to help and respond
asap.
11-06-2013, 09:50 PM #5
Default Avatar
Oneup
Guest
Originally posted by jakerad95 View Post
Hi, first thanks for helping Smile Second this is very simple. Here is the question:

11. Report the order ID, required date, shipped date of all orders that were shipped one or more days after the required date.

So far I have:
SELECT OrderID, RequiredDate, ShippedDate
FROM Orders
WHERE (ShippedDate>=1RequiredDate);

Results do pop up, but there are 803 and there are multiple instances that show the ship date occurred before the Required Date. What I need to do is refine the results to show which products are shipped 1 or more days after the required date. Any help would be appreciated.

I WILL REP+

Well if you want 1 or days after the fact then you can't have >= you need to remove the equal sign.
You must login or register to view this content.

Using datediff should help you with your problem
11-09-2013, 04:17 PM #6
spudeeelad
I defeated!
Originally posted by jakerad95 View Post
Hi, first thanks for helping Smile Second this is very simple. Here is the question:

11. Report the order ID, required date, shipped date of all orders that were shipped one or more days after the required date.

So far I have:
SELECT OrderID, RequiredDate, ShippedDate
FROM Orders
WHERE (ShippedDate>=1RequiredDate);

Results do pop up, but there are 803 and there are multiple instances that show the ship date occurred before the Required Date. What I need to do is refine the results to show which products are shipped 1 or more days after the required date. Any help would be appreciated.

I WILL REP+


Use DATEADD.
    
Where ShippedDate > DATEADD(Day, + 1, RequiredDate)

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo