Link to home
Create AccountLog in
Avatar of Wilder1626
Wilder1626Flag for Canada

asked on

Oracle - max date filter issue

Hello all

I have this query bellow that pulls the Max date.

But when i query, i dont get the max date.

  SELECT   DISTINCT A.CARRIER_ID,
                    MAX (A.EFFECTIVE),
                    A.TRLR_TYPE_ID,
                    A.CURRENT_NUM_VEHICLES,
                    L.NAME
    FROM   TL_RESOURCE_TRLR A, CARRIER_EQUIP B,LANE L
   WHERE   A.CARRIER_ID = B.CARRIER_ID(+)
           AND A.TRLR_TYPE_ID = B.TRLR_TYPE_ID(+)
           AND A.LANE_ID = L.ID
           AND B.CARRIER_ID IS NULL -- EXCLUDE ROWS ADDED BECAUSE  OF THE OUTER JOIN
GROUP BY   a.carrier_id, a.trlr_type_id, current_num_vehicles, L.NAME
ORDER BY   A.CARRIER_ID ASC;

Open in new window


Example:

From resources table:
User generated image

From Query result:
User generated image
How can i fix that please?

Thanks again for your help
SOLUTION
Avatar of awking00
awking00
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Wilder1626

ASKER

Oh sure.

Here you will see the resources extract and also the resources query result.

Thanks again
resources-TABLE.xls
resources-result.xls
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Hello guys,

Thanks for your help and sorry for the delay. I will work this out a little bit more.

markgeerm you are right.

I will re open another topic when i'm done thinking about all this.

Thanks again