Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select From???

Author  Topic 

thegladiator
Starting Member

2 Posts

Posted - 2011-11-11 : 17:16:00
I am trying to run a query based on a query and a table. this is what i have and what i want

Dataset 1 (query)
P/N
InvCost
Template Number

Dataset 2 (table)
Primary Key (Template)
margin1
margin2
margin3
break1
break2
break3

This is the explanation of what i have and want to do

1) I have p/n's in our system that i want to assign a resale to based on the items cost.
2) Each record(row) has been assigned a Template Number which will define the desired resale. The template number was manufactured using an iif statement in Dataset 1(query).
3) I have created dataset 2 which is table that houses the resale margins which will be used to construct the resales and the breaks that i want to assign at set buy qtys.
4) What i want to do is create another query that has in it a sql statement that evaluates each row of dataset 1 allowing me to calculate resales based on what template number is assigned to it to be used from dataset 2.

I know this is possible, just having trouble wrapping my head around how to do this. I have taught myself access and sql and this is just one concept i can't quite master yet.

thanks

thegladiator
Starting Member

2 Posts

Posted - 2011-11-11 : 19:10:23
actually, looks like i have it. Long day and wasn't thinknig right. my tables and relationships are setup properly so i'm good to go
Go to Top of Page
   

- Advertisement -