>I have the remote view
>
>SELECT Pftenants.tn_key, Pftenants.tn_pfkey, Pftenants.tn_tekey,;
> Pftenants.tn_tenantname, Pftenants.tn_leaseterm,;
> Pftenants.tn_leaseexpiry, Pftenants.tn_area, Pftenants.tn_percrent,;
> Pftenrent.tr_rate, Pftenants.tn_spacetype,Pftenants.tn_dateentered,;
> Pftenrent.tr_startdate, Pftenants.tn_vacant;
> FROM dbo.PFTENANTS Pftenants, dbo.PFTENRENT Pftenrent;
> WHERE Pftenants.tn_key = Pftenrent.tr_tnkey;
> AND Pftenants.tn_pfkey = ?rv_pf.pf_key;
> ORDER BY Pftenants.tn_tenantname, ;
> Pftenrent.tr_startdate DESC
>
>which after the gives me several records for the same tenant with different rates. I need just first record of them. How I can get rid of others in one view definition?
If I understand what your asking I think I can help.
Below is a view in which the GROUP BY option for the SELECT command is used to Group the results by a unique ID, which means that they are only listed once in the result set.
SELECT Hours.cgroupid, Active.cproject, Active.caccount,;
Active.cactivity, Hours.ddate, SUM(Hours.ntime), Hours.chourid;
FROM projmain!hours INNER JOIN projmain!active ;
ON Hours.cgroupid = Active.cgroupid;
WHERE Hours.cempid = ?cPassID;
GROUP BY Hours.cgroupid
If you plan on changing data in the result set and sending the changes back to the server, I am not sure if my suggestion will help you.
Jeff
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only