Distinct data

T

The Rook

Sorry if this is simple but I am very new to SQL. I currently have a link
into our MRP database and am wanting to set up a query to show how many
technical drawings we have per part an the works orders they are allocated
to. Please find below the current SQL:

SELECT dbo_DRAWMOVE1.Drawing, dbo_DRAWREF1.Copies,
dbo_DRAWMOVE1.Copies_Moved, dbo_DRAWMOVE1.Move_Issue_Ref,
dbo_DRAWMOVE1.Movement_Type
FROM dbo_DRAWMOVE1 INNER JOIN dbo_DRAWREF1 ON dbo_DRAWMOVE1.Drawing =
dbo_DRAWREF1.Drawing;

The problem that I have got is when a drawing has been brought back it shows
as a negative in to Copies_moved so I have to go through all the positives
and chec is there is a negative then ignore them.

Is there anyway of just reporting distinct recordes from Move_issue_ref, ie
if it appears twice do not so it?

Hope that is clear
 
K

KARL DEWEY

Why not SUM your dbo_DRAWMOVE1.Copies_Moved and that way the positives will
cancel the negatives.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top