This question was created from SQL-HW-Exercises-SQL-Server-F-16 https://www.coursehero.com/file/20708947/SQL-HW-Exercises-SQL-Server-F-16/
for question 3 or #49 on the document. a SELECT statement that returns these colums from the Orders table: A column that uses the CONVERT function to return the OrderDate column in this format: MM/DD/YYYY. In other words, use two-digit months, days, and years and separate each date component with slashes A column that uses the CONVERT function to return the OrderDate column with the date, and the hours and minutes on a 12-hour clock with an am/pm indicator A column that uses the CONVERT function to return the OrderDate column with 2-digit hours, minutes, and seconds on a 24-hour clock. Use leading zeros for all date/time components.
(a)Return a column that convert the orderdate in format of mm/dd/yyyy with all leading zeroes. SELECT ... View the full answer
- SELECT CONVERT(varchar, OrderDate,101) AS OrderDate, CONVERT(varchar, OrderDate) AS OrderDate2, CONVERT(varchar, OrderDate,8) AS OrderDate3 FROM Orders; this was the original answer that a tutor posted but it comes up incorrect, i tried yours and it saids ORA-00923: FROM keyword not found where expected
- Oct 03, 2018 at 5:24pm
- This error generally comes when From is not written in its correct form. Use semicolon at the end and check if you are using from correctly.
- Oct 03, 2018 at 5:32pm
- no, i tired changing the FROM products to different tables and used semicolon, didnt work
- Oct 03, 2018 at 5:39pm
- Provide your database so that I can work on the same.
- Oct 03, 2018 at 5:41pm
- Oct 03, 2018 at 5:42pm