Testing Value & put Result in Query-URGENT HELP-

igourine

Registered User.
Local time
Yesterday, 16:54
Joined
Nov 8, 2010
Messages
39
Please i need help

DRW N Action

400 RTO
400 Send to RT
400 RTO
400 RTO[/color]
500 RTO
500 Send to RT
500 RTO
500 Send to RT

i want to test the rows & get the latest Row Action for each DRW N (400 = RTO - 500=Send to RT)
Please note that i have many DRW N duplicated in my Table (400-500-600...etc)
 
Are DRW N and Action the only two fields in your table, or do you also have a date/time field or an Autoidentity field in your table?
 
no i have also date for each record
do you have any suggestion will be much appreciate
 
Providing that your table structure is something like the following:
Code:
MyTable
-------
DRW N (Drawing Number)
DRW Date (Action Date)
Action

Your SQL should look like the following (substitute highlighted text with actual table/field names):
Code:
SELECT T1.*
FROM [B][I]MyTable[/I][/B] AS T1
WHERE T1.[[B][I]DRW Date[/I][/B]] = (
    SELECT MAX(T2.[[B][I]DRW Date[/I][/B]])
    FROM [B][I]MyTable[/I][/B] AS T2
    WHERE T2.[[B][I]DRW N[/I][/B]] = T1.[[B][I]DRW N[/I][/B]]);
 
Dear Sir,

Many thanks it works but still did not gave me a result (Rows empty)
it shall give me

last update with other information for each DWG
 

Users who are viewing this thread

Back
Top Bottom