J
jgeniti
Can someone please help me with the logic behind the query I'm trying
to run.
I am trying to return 1 record per ProjNum using the following
criteria.
If FG_ind = F then return that row. (There is never more then one F
per project number)
If there is no F then I need to get the last modified record
(Maint_date) with a "1" in the O_ind field.
I tried creating a query and then sorting by Proj #, then FG_ind(Desc)
and then Maint_date(Desc). When I run the query the correct row is
always on top for each project, but when I try to group them so I can
try to get the first record it allways returns more then one row
because I have sever non-distinct fields that are in the query. I
thought maybe there was a way to add some logic to the criteria of the
FG_ind field in the query.
Any help would be appreciated.
EstNum ProjNum FG_ind O_ind Maint_date Year
1 25 1 1/1/2010 2010
2 25 1 11/5/2008 2010
3 25 F 1 5/6/2009 2010
4 57 1 2/2/2010 2010
5 57 1 5/5/2010 2010
to run.
I am trying to return 1 record per ProjNum using the following
criteria.
If FG_ind = F then return that row. (There is never more then one F
per project number)
If there is no F then I need to get the last modified record
(Maint_date) with a "1" in the O_ind field.
I tried creating a query and then sorting by Proj #, then FG_ind(Desc)
and then Maint_date(Desc). When I run the query the correct row is
always on top for each project, but when I try to group them so I can
try to get the first record it allways returns more then one row
because I have sever non-distinct fields that are in the query. I
thought maybe there was a way to add some logic to the criteria of the
FG_ind field in the query.
Any help would be appreciated.
EstNum ProjNum FG_ind O_ind Maint_date Year
1 25 1 1/1/2010 2010
2 25 1 11/5/2008 2010
3 25 F 1 5/6/2009 2010
4 57 1 2/2/2010 2010
5 57 1 5/5/2010 2010