Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display double rows only one time, How ?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi there,
I have a table, named "Art" and a browser who can work with a freeform-query.
My table contains more than rows with the same value:
Example :

Nr Shipped
------ -----------
110 50
110 55
110 50
110 60
110 55
110 50
110 60
110 55


You see my problem ?
I want to display only one of each values:

Nr Shipped
----- ------------
110 50
110 55
110 60


What kind of query do i have to make ?


Greets

 
depends on your code
but use either
FOR FIRST or LAST
FIND FIRST or LAST
or
use BREAK BY plus
use and IF LAST-OF (break by field name) then
Display etc


 
If you are using a browser, then you can't really use last-of() directly since the browser is built like an OPEN QUERY statement.

With complicated queries i often build a temp table up, then make the freeform query be "for each tempTable". In this case you could build the temp table with the BREAK option (as mentioned already), and only create a record in the temp table when LAST-OF(repeating_field_name).

Note that this shouldn't really be necessary. What else is in the table that means you have repeated NR and shipped values? Situations like this can usually be better solved by modifying the table structure (so you don't have repeating data - this is moved to another table and joins to the current one).

I know this is often impossible because of existing code, but something to think about anyways.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top