Query will only return maximum of one result

mor

Registered User.
Local time
Today, 19:33
Joined
Jun 28, 2013
Messages
56
Hello everyone,

Does anyone know why this SQL will return only one query maximum?

DateLimiter: (SELECT Date_Retro_Fees_Rate FROM tblRetroFees AS Alias WHERE Date_Retro_Fees_Rate = (SELECT FIRST(Date_Retro_Fees_Rate) FROM tblRetroFees AS Alias2 WHERE Alias2.Date_Retro_Fees_Rate > tblRetroFees.Date_Retro_Fees_Rate AND Alias2.Id_Product = tblRetroFees.Id_Product) AND Alias.Id_Product = tblRetroFees.Id_Product)

A picture of the table is included. Thank you for your help!
 

Attachments

  • Capture.JPG
    Capture.JPG
    51.6 KB · Views: 110
Yes, because all your Date_Retro_Fees_Rate values are unique. I have no clue what you are trying to do, but that second SELECT will only return 1 value. Since it will only return one value and your Date_Retro_Fees_Rate values are unique, using it in the WHERE clause of your first SELECT statement will cause it to only return one record.

I'm not going to help you fix it, because its too convoluted for me to understand. But if you want to explain to me in plain english what you want your query to return, I can help you build a query to do that. Be sure to provide what exact data should be returned from your query based on the sample data you have provided.
 

Users who are viewing this thread

Back
Top Bottom