K
karen
I need help with using IIF in my query. I need to make one
calculation based on one criteria and another calculation
based on another. For example:
ProjectID
ProjectType
ProjectType can be either 1 or 2. If it's 1, I need to
divide the Amount by half and if Amount is 2 then the
number is not divided. A copy of the SQL follows in case
this is as clear as mud.
SELECT [tbl Allocation].AllocationDesignationID, [tbl
Allocation].AllocationID, [tbl Allocation].ProjectID, [tbl
Projects].ProjectType, [tbl Allocation].EmployeeID, [qry
NetRevenue].[Net Revenue], [tbl Allocation].Percentage,
[Net Revenue]*[Percentage] AS Amount
FROM [tbl Projects] INNER JOIN (([tbl Allocation
Designation] INNER JOIN [tbl Allocation] ON [tbl
Allocation Designation].AllocationDesignationID = [tbl
Allocation].AllocationDesignationID) INNER JOIN [qry
NetRevenue] ON [tbl Allocation].ProjectID = [qry
NetRevenue].ProjectID) ON ([qry NetRevenue].ProjectID =
[tbl Projects].ProjectID) AND ([tbl Projects].ProjectID =
[tbl Allocation].ProjectID);
Thanks!
karen
calculation based on one criteria and another calculation
based on another. For example:
ProjectID
ProjectType
ProjectType can be either 1 or 2. If it's 1, I need to
divide the Amount by half and if Amount is 2 then the
number is not divided. A copy of the SQL follows in case
this is as clear as mud.
SELECT [tbl Allocation].AllocationDesignationID, [tbl
Allocation].AllocationID, [tbl Allocation].ProjectID, [tbl
Projects].ProjectType, [tbl Allocation].EmployeeID, [qry
NetRevenue].[Net Revenue], [tbl Allocation].Percentage,
[Net Revenue]*[Percentage] AS Amount
FROM [tbl Projects] INNER JOIN (([tbl Allocation
Designation] INNER JOIN [tbl Allocation] ON [tbl
Allocation Designation].AllocationDesignationID = [tbl
Allocation].AllocationDesignationID) INNER JOIN [qry
NetRevenue] ON [tbl Allocation].ProjectID = [qry
NetRevenue].ProjectID) ON ([qry NetRevenue].ProjectID =
[tbl Projects].ProjectID) AND ([tbl Projects].ProjectID =
[tbl Allocation].ProjectID);
Thanks!
karen