Link to home
Start Free TrialLog in
Avatar of nmarano
nmarano

asked on

Query Help

Experts-

I'm looking for some help with a query that I have.  I am looking to return the newest record based on the date.  Here is what I have, but it is returning all records rather than just the record with the newest date.  Any help would be appreciated

-Nick

select distinct clients.productid AS productID, client_price.price as price,MAX(client_price.dateStart)
            from clients
            left join client_price on client_price.clientid = clients.id
        where client_price.opportunityID = 0
        and clients.productID = 3
        group by clients.productid,client_price.price
SOLUTION
Avatar of brad2575
brad2575
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial