• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

SQL Question

rcomo

Senior member
In my current job I am learning SQL - while having to write valid SQL statements. I need some help designing a query that checks hire dates for establishing participation for (something).

So the statement establishing participation has to have a WHERE clause that will check HIRE_DATE and establish two different goals:

1. WHERE Hire_Date < OCTOBER 1 of this current year
2. WHERE Hire_Date < OCTOBER 1 of previous year



Different question now that I am thinking about it: some of these previous SQL statements have a @ symbol, what does that mean in SQL? Can't find an online resource that references that symbol 🙁
Example: IF @Type IN ('Workflow','All')

Thanks for the help in advance.

Rob
 
@ denotes a variable in a statement if I remember correctly.

What database are you writing against? SQL Server or Oracle?
 
use the GetDate() function ... it pulls the current system date.

select * from emp_history
where effective_date <= getdate()

This pulls all employee records where the effective date is less than or equal to today.

select * from emp_history
where eff_date <= getdate() - 30

This pulls all employee records where the effective date is less than or equal to today - 30 days (i.e. July 1st)
 
Back
Top