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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calc Max query problem

Status
Not open for further replies.

HOTLIPS

Technical User
Dec 5, 2000
55
GB
Hi
Can anyone help
I have a table of Equipment Items... these items have a holder and a location.. and the table is a history table containing a record of the date, the new holder and new location.. everytime the item changed holder and location.....
My problem is I want to select the last date the item was transferred and the particular holder and location of that last date.
I would like to do it in 1 query....as the answer is an inmemory tcursor
Table fields
EqNo Eqtype TransferDate Holder location
Thanks
Hotlips
 
Hotlips,

Instead of returning Date, replace the checkmark with MAX. that should return the latest holder and location for the item(s) you're selecting.

Hope this helps...

-- Lance
 
Thanks Lance.........
........but I need the EqNo Eqtype the last date and the holder name and location at that last date......
any suggestions ???..... could it be done using SQL in paradox?????
Thanks hotlips
 
I may have misunderstood the problem but wouldn't the following query do the job. 'No' is a variable containing the item of interest.

Query
ANSWER: :pRIV:ANSWER.DB

SORT: :pRIV:testing.db->"TransferDate", :pRIV:testing.db->"EqNo",
:pRIV:testing.db->"EqType", :pRIV:testing.db->"Holder", :pRIV:testing.db->"Location"

:pRIV:testing.db | EqNo | EqType | TransferDate | Holder | Location |
| Check ~No | Check | Check | Check | Check |

EndQuery

The record of interest should be the last in :pRIV:ANSWER.DB.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top