Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with SQL Syntax
Message
 
 
To
08/03/2002 09:37:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00630077
Message ID:
00630180
Views:
18
You should take in account re_date also.
SELECT Cl_Ref, re_date, MIN(R.Re_Time) ;
  FROM Referral R;
 WHERE BETWEEN(DTOS(R.Re_Date), "20010101", "20010201");
 GROUP BY Cl_Ref, Re_Date
  INTO CURSOR Minimums NOFILTER

SELECT *;
  FROM Referral;
 WHERE BETWEEN(DTOS(Re_Date), "20010101", "20010201");
   AND DTOS(re_date) + Re_Time = (SELECT DTOS(re_date) + min_re_time ;
   		    FROM Minimums;
   		   WHERE Minimums.Cl_Ref = Referral.Cl_Ref) ORDER BY Cl_Ref
>Here is the only other way (with minimum) effor that I can think to do it:
>
>
SELECT Cl_Ref, MIN(R.Re_Time) ;
>  FROM Referral R;
> WHERE BETWEEN(DTOS(R.Re_Date), "20010101", "20010201");
> GROUP BY Cl_Ref, Re_Date
>  INTO CURSOR Minimums NOFILTER
>
>SELECT *;
>  FROM Referral;
> WHERE BETWEEN(DTOS(Re_Date), "20010101", "20010201");
>   AND Re_Time = (SELECT min_re_time ;
>   		    FROM Minimums;
>   		   WHERE Minimums.Cl_Ref = Referral.Cl_Ref) ORDER BY Cl_Ref
>
>
>
>If anyone can think of another way, please let me know.
>
>Thanks
>Kev
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform