Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (anonymous):

SQL question Find the order number and the number of days elapsed between today's date and the delivery date of the orders placed by the clients. order number: order_no (from sales_order table) Functions to be used TO_CHAR or TO_DATE SQL question Find the order number and the number of days elapsed between today's date and the delivery date of the orders placed by the clients. order number: order_no (from sales_order table) Functions to be used TO_CHAR or TO_DATE @Computer Science

OpenStudy (anonymous):

order date: order_date

OpenStudy (anonymous):

SELECT order_no FROM sales_order WHERE order_date between to_date ('2011/01/01', 'yyyy/mm/dd') AND to_date ('2011/11/07', 'yyyy/mm/dd'); This SQL statement would return all orders where the order_date is between Jan 1, 2011 and Nov 07, 2011 (inclusive).

OpenStudy (farmdawgnation):

If you're just limited to those functions, then I don't know if I can help you. But if you could use the full range of date methods - then in MySQL you can do the following: SELECT order_no, DATEDIFF(CURDATE(), order_date) FROM sales_order

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!