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

This is probably a very simple ques 1

Status
Not open for further replies.

JCAA

MIS
Jun 22, 2003
65
US
This is probably a very simple question but I do not know how to do it. I have the following query to get my data out:

SELECT [MMM - File with DRP Logic Applied].[Part Number], [MMM - File with DRP Logic Applied]![DomFcst01]*([MasterDate]![Weekly Days]/[MasterDate]![Monthly Days]) AS DomWk01, [MMM - File with DRP Logic Applied]![DomFcst01]*([MasterDate]![Weekly Days]/[MasterDate]![Monthly Days]) AS DomWk02, [MMM - File with DRP Logic Applied]![DomFcst01]*([MasterDate]![Weekly Days]/[MasterDate]![Monthly Days]) AS DomWk03
FROM [MMM - File with DRP Logic Applied] LEFT JOIN MasterDate ON [MMM - File with DRP Logic Applied].Link = MasterDate.Link
WHERE (([sort]=1)) OR (([sort]=2)) OR (([sort]=3));

I need to be able to get the data correlating to [sort]=1 in DowWk01, [sort]=2 in DowWk02, and [sort]=3 in DowWk03
Right now I am getting all 3 in all of them but I just want a third of that data. I am not sure if this makes sense or not and I realize it sounds stupid but I don't know how else to explain it.
How will I get the data from [sort]=1 in DowWk01 and nothing else etc.

THANKS!!
 
Something like this will only show results for sort=1 in the DomWk01 field.

IIf([Sort]=1,[MMM - File with DRP Logic Applied]![DomFcst01]*([MasterDate]![Weekly Days]/[MasterDate]![Monthly Days]),0) AS DomWk01

You'll have to add a GROUP BY clause, though, to combine the records. I cannot tell if the results of your calculations can be added together or not for each part number. Play around with the above IIf expression and post what you need next.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top