difference in field

jasn_78

Registered User.
Local time
Tomorrow, 00:54
Joined
Aug 1, 2001
Messages
214
hey guys im not even sure if i have the heading right for this one.
I have a table example data attached,

what i would like to do is return all transfers from that table where all the item numbers in a batch dont equal each other i.e if you subtract them all in a batch it doesnt = 0

i have know idea how to do this and dont know if this is even the right way of doing what i need which is to show transfers where some1 has transferred a product to a different one which we do want to have happen we just need to know when it was done.

any suggestions?
 

Attachments

  • TRANSFERS.jpg
    TRANSFERS.jpg
    47.6 KB · Views: 121
Last edited:
None of the fields in the screen shot will total to zero. What exactly are you wanting to do?
 
neil got it thanks mate

Code:
SELECT DISTINCT a.HTRX_REF_NO, a.HTRX_REC_TYPE, a.HTRX_TRX_DATE, Format([a].[HTRX_TIMESTAMP],"dd/mm/yy hh:nn") AS TIME_DATESTAMP, AREATBL.AREA_DESC, a.HTRX_AREA_NUMBER
FROM AREATBL INNER JOIN htrxtbl AS a ON AREATBL.AREA_NUMBER = a.HTRX_AREA_NUMBER
WHERE (((a.HTRX_REC_TYPE)="TRANSFER") AND ((a.HTRX_QTY_1)<0) AND ((Exists (SELECT
    1
FROM
    htrxtbl as b
WHERE
    a.htrx_ref_no = b.htrx_ref_no
AND a.htrx_item_number = b.htrx_item_number
AND b.HTRX_QTY_1 > 0  
))=False))
ORDER BY a.HTRX_REF_NO;
 

Users who are viewing this thread

Back
Top Bottom