Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to get the oldest date

Author  Topic 

nuruddean
Starting Member

11 Posts

Posted - 2010-05-07 : 02:40:05
I've run this script

select person_id, gd.segment4||gd.segment5 ,effective_start_date
from per_all_assignments_f paf,per_grades gr, per_grade_definitions gd
where paf.GRADE_ID = gr.grade_id
and gr.grade_definition_id = gd.grade_definition_id
and person_id = 1799
group by person_id,gd.segment4||gd.segment5,effective_start_date

and the output is

PERSON_ID GD.SEGMENT4||GD.SEGMENT5 EFFECTIVE_START_DATE
1799 DS45 10/2/1989
1799 DS45 1/8/2007
1799 DS45 6/1/2007
1799 DS45 6/1/2008
1799 DS52 11/13/2008
1799 DS52 1/1/2010

how i want to get the oldest date?

My Name is Nuruddin

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-07 : 02:49:19
Maybe type in a DISTINCT after the SELECT and type min(effective_start_date) instead of effective_start_date


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-05-07 : 02:50:19
You are not using SQL Server. It is best that you post in an Oracle forum. You will get better answer there.

We can only provide you the solution in SQL Server's T-SQL.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-05-07 : 05:13:52
This site is for MS SQL Server
For Oracle questions post at www.orafaq.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -