Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Lesson Lab – Date Functions

Questions

1. Found out how many months it has been since the orders have shipped. Use the Orders table.

2. Using the Invoices table, calculate the due date of the invoices by adding 30 days to the Invoice
Date field.

3. Using the Invoices table, format the Invoice Date field as a long date.

4. Display the Order ID field and month of the Order Date field for the records in the Orders table.

5. Find the number of days that passed between the Submitted Date and the Creation Date of
purchase orders. Use the Purchase Orders table.

Microsoft Access: SQL for Non-Programmers | Udemy.com


IsaBel Harrison
Answers

1.

SELECT DATEDIFF('m', [Shipped Date], DATE()) AS [Months Passed]

FROM Orders

2.

SELECT [Invoice Date], DATEADD('d', 30, [Invoice Date]) AS [Due Date]

FROM Invoices

3.

SELECT FORMAT( [Invoice Date], "Long Date") AS [Date]

FROM Invoices

4.

SELECT [Order ID], DatePart('m', [Order Date]) AS Month

FROM Orders

5.

SELECT [Purchase Order ID], DATEDIFF( 'd', [Submitted Date], [Creation Date]) AS [Days Elapsed]

FROM [Purchase Orders]

Microsoft Access: SQL for Non-Programmers | Udemy.com


IsaBel Harrison

You might also like