Jump to content

SQL question:I need to get the latest record base on date


Fjimenez
 Share

Recommended Posts

Hello All, I am trying to get the latest record available for a field, I want to learn how to write/pull what I know as of  record status "1" from my results

since let's say; an activity was updated several times but I just need the latest update base on the date, I tried using distinct and it worked: each row is different but I am still receiving all the updates of each activity. I tried to use (Group by) base in the activity Id and I am receiving this error message "Column 'activity_name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause."

 

 I am using the Microsoft SQL server management studio.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...