SQL query not working need help

i am trying to write a SQL query to pull all students that have graduated May 2012 to the present date

also i cannot figure out the query to pull last semester date for each student

if you have a template where i can fill in the blanks that would be awesome or some links to where i can get help

we are using SQL 2014

any and all help will be greatly appreciated
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vitor MontalvãoMSSQL Senior EngineerCommented:
You didn't give any example or sample data so this will be more like a general answer.
pull all students that have graduated May 2012 to the present date
FROM Students
WHERE GraduateDate>='2012-05-01'

Open in new window

pull last semester date for each student
How are you storing the semester?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HuaMin ChenProblem resolverCommented:
SELECT * FROM students WHERE graduateDate='2015-05-15'

Open in new window

If you want a template, you can also consider to program in Excel Macro and to link to Sql server, from Excel file.

Scott PletcherSenior DBACommented:
SELECT e.student_id, s.name AS student_name, MAX(e.semester_date) AS last_semester_date
FROM enrollment e
    SELECT student_id, name
    FROM students
        graduation_date >= '20120501'
) AS s ON
    s.student_id = e.student_id
amoosAuthor Commented:
thank you guys.  great help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.