Sql

Arti K.

asked • 07/10/22

SQL Queries working with dates

Write a query that will list the employee number, employee last name, employee first name, employee hire date, a computation of the number of years since the employee was hired up to the date you run the query and the query run date. List the computed number of years as YEARS EMPLOYED and the query run date as QUERY DATE.


what I am doing wrong here? Please help

SELECT EMP_NUM,EMP_LNAME,EMP_FNAME,EMP_HIREDATE,QUERY_RUNDATE= '07/28/2011'- EMP_HIREDATE,SUM(EMP_YEARS) AS YEARS_WORKED

FROM EMPLOYEE

GROUP BY EMP_YEARS

2 Answers By Expert Tutors

By:

Alex D. answered • 08/09/22

Tutor
4.9 (183)

Senior Data Analyst (Tableau, Google and IBM certified)

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.