Need help with my HW brews and brehettes...SQL related!!

Rawtid

Veteran
Supporter
Joined
Jun 23, 2012
Messages
43,323
Reputation
14,678
Daps
119,448
@HabitualLineSteppa

It's ok cause if you can figure out the ages at the date of hire you can just add the number of service years To it to get current age right? If you were 20 when you got hired and you have 20 service years you're 40 today.
 

HabitualLineSteppa

....Fuh Q.
Joined
May 1, 2012
Messages
2,634
Reputation
1,201
Daps
9,599
@HabitualLineSteppa

It's ok cause if you can figure out the ages at the date of hire you can just add the number of service years To it to get current age right? If you were 20 when you got hired and you have 20 service years you're 40 today.
The ages at the date of hire are to the right of the dates I posted prior...
And you are right...Simple math like you pretty much said....Problem is, I need to create a query that reflects this logic including a case that specifies each employee above a certain age bracket...

Swear breh...SQL has been scressful....:mindblown::scusthov::dead:
 

Rawtid

Veteran
Supporter
Joined
Jun 23, 2012
Messages
43,323
Reputation
14,678
Daps
119,448
The ages at the date of hire are to the right of the dates I posted prior...
And you are right...Simple math like you pretty much said....Problem is, I need to create a query that reflects this logic including a case that specifies each employee above a certain age bracket...

Swear breh...SQL has been scressful....:mindblown::scusthov::dead:
Ok create a column called age and use that in the case statement.
 

unit321

Hong Kong Phooey
Joined
May 2, 2012
Messages
22,214
Reputation
1,785
Daps
23,104
Reppin
USA
"Assuming that today’s date is 12/2/2025, create a temporary field that calculates the total service time (in years) of each
employee.

In the same query, use a CASE statement to identify employees who are over 54 years old and have over 20 years of service time with the company. Identify them as “Potential Retirees”".

For reference, these are the tables and column I at least KNOW this data will derive from

Table Names: Employee

Columns needing to be manipulated: employee.HireDate, employee.FirstName, employee.LastName, employee.age
First, you'll want to use ONE format for your date. By format, I mean, yyyy-mm-dd or mm-dd-yyyy or whatever else you prefer. But you stick with one.
Second, depending on what kind of SQL methods/functions you have available, find the ones that will do the work for you. SQL Server has DATEDIFF() or DATEADD()
 
Top