Query Help Requested 
Author Message
 Query Help Requested
I am using Paradox 3.5 for dos (due to reasons beyond my control) and need to

know what the query operator is to simply pull up ONLY the LAST RECORD in a

table.  The records are arranged by a date field, but if there are more than

one line item with the last date, they are all pulled up.  Thanks for any

help.




Fri, 07 Aug 1998 03:00:00 GMT
 Query Help Requested

Quote:

>I am using Paradox 3.5 for dos (due to reasons beyond my
>control) and need to know what the query operator is to simply
>pull up ONLY the LAST RECORD in a table.  The records are
>arranged by a date field, but if there are more than
>one line item with the last date, they are all pulled up.

There is no way to do it with a query operator.  You can however
use a while loop.  Set up a string variable, open the table with
a tcursor attached.  Initialize the variable with the date, have
the while loop run until the date doesn't match the value in the
variable.  Don't forget to advance the pointer each time through
the while loop.  Then do whatever processing you need to when it
encounters the last record for the group.


Sat, 08 Aug 1998 03:00:00 GMT
 Query Help Requested
on Mon, 19 Feb 1996 23:27:59 -0800, Jerry Bret Archibald

Quote:

>I am using Paradox 3.5 for dos (due to reasons beyond my control) and need to
>know what the query operator is to simply pull up ONLY the LAST RECORD in a
>table.  The records are arranged by a date field, but if there are more than
>one line item with the last date, they are all pulled up.  Thanks for any

>help.

I don't think there is anything in the query that can do this.  You can
write a script that would view the table and move to the last record very
simply.  e.g.

view "tab"
end

will position the table "tab" to the last record and leave the table on the
workspace.  You could get a little fancier by allowing the user to enter
the name of a table before the view command.

Bev.



Sun, 09 Aug 1998 03:00:00 GMT
 Query Help Requested

Quote:


>>I am using Paradox 3.5 for dos (due to reasons beyond my
>>control) and need to know what the query operator is to simply
>>pull up ONLY the LAST RECORD in a table.  The records are
>>arranged by a date field, but if there are more than
>>one line item with the last date, they are all pulled up.
>There is no way to do it with a query operator.  You can however
>use a while loop.  Set up a string variable, open the table with
>a tcursor attached.  Initialize the variable with the date, have
>the while loop run until the date doesn't match the value in the
>variable.  Don't forget to advance the pointer each time through
>the while loop.  Then do whatever processing you need to when it
>encounters the last record for the group.

Whoa! Tcursors are for Windows versions. To get the last record in a
table use following PAL script:

        VIEW "table"                      ; get table on workspace
            END                                  ; move to last record
            COPYTOARRAY xx            ; copy to an array.

A similar example is on page 267 of the 3.5 PAL User's guide. You can
then use the array items to get your data or use COPYTOARRAY to stuff
the record into another table of same structure as the original table.

Stefan Schader, ELBE Consulting Inc., Canada             416 409-3368

Home page: http://www.interlog.com/~elbe
Windows 95 up and running and Networking since Sept. 01/95



Tue, 11 Aug 1998 03:00:00 GMT
 Query Help Requested
not familiar with version 3.5 but what about the following :

attach a cursor to the table
go to the last record

This is probably much faster than any query you might think off
(supposing 3.5 supports the above solution)



Tue, 11 Aug 1998 03:00:00 GMT
 Query Help Requested

Quote:

> I am using Paradox 3.5 for dos (due to reasons beyond my control) and need to

> know what the query operator is to simply pull up ONLY the LAST RECORD in a

> table.  The records are arranged by a date field, but if there are more than

> one line item with the last date, they are all pulled up.  Thanks for any

> help.



Ya did not say if the table was Keyed.
Is the Table Primary Key on [date]? Then What is the Secondary Key?
Try Calc Max in Both Key Fields Then
do a "Locate fieldval1. fieldval2"

Another thing to try is the "Find" Query and Goto the END of "Answer"
this assumes you DONOT want to edit this record, only review it's
contents.

Steve

--
        _
       | \                           Derek and Jania
       |  )erek

  / / /                              http://www.greenduck.com



Wed, 19 Aug 1998 03:00:00 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. Query help requested for Login information

2. Query Help Request

3. Query help request

4. Query help request !

5. Query Help Request

6. Query Help request

7. Query Help Requested!

8. SQL QUERY Help Requested

9. Request help with English Query for Analysis Services

10. Urgent help request: for a VERY complex query

11. Requesting help with complicated query


 
Powered by phpBB® Forum Software