if (Escalation/Assignment = 0) or (Updateheat = 0 )or (Worklog = 0), then 0
for the total. Else total.
How would you set this up in design query? Each of the above is a seperate
table
Query:
SELECT DISTINCTROW tblMonitoringData_OLD.[HEAT ID],
[tblEscalation/Assignment]![Points Earned]+tblUpdateHeat![Points
Earned]+tblWorklog![Points Earned] AS [Documenation Pts],
[tblEscalation/Assignment].[Points Earned] AS [Escalation?Assign],
tblUpdateHeat.[Points Earned] AS UpdateHeat, tblWorklog.[Points Earned] AS
Worklog
FROM ((tblMonitoringData_OLD LEFT JOIN [tblEscalation/Assignment] ON
tblMonitoringData_OLD.[Escalation/Assignment] =
[tblEscalation/Assignment].ID) LEFT JOIN tblUpdateHeat ON
tblMonitoringData_OLD.UpdateHeat = tblUpdateHeat.ID) LEFT JOIN tblWorklog ON
tblMonitoringData_OLD.Worklog = tblWorklog.ID
GROUP BY tblMonitoringData_OLD.[HEAT ID], [tblEscalation/Assignment].[Points
Earned], tblUpdateHeat.[Points Earned], tblWorklog.[Points Earned];
|
|
0
|
|
|
|
Reply
|
Utf
|
6/7/2010 7:11:03 PM |
|
Do you mean each is a separate field in a separate table?
IIF(tblUpdateHeat.[Points Earned]=0 OR tblWorklog.[Points Earned] OR
[tblEscalation/Assignment]![Points Earned] = 0, 0,
[tblEscalation/Assignment]![Points Earned]+tblUpdateHeat![Points
Earned]+tblWorklog![Points Earned])
Basically the IIF consists of three arguments.
First a conditional statement X=Y
Second the response if the conditional statement is TRUE
Third the response if the conditional statement is NOT TRUE
SELECT DISTINCT tblMonitoringData_OLD.[HEAT ID],
IIF(tblUpdateHeat.[Points Earned]=0 OR tblWorklog.[Points Earned] OR
[tblEscalation/Assignment]![Points Earned] = 0, 0,
[tblEscalation/Assignment]![Points Earned]+tblUpdateHeat![Points
Earned]+tblWorklog![Points Earned]) AS [Documenation Pts]
, [tblEscalation/Assignment].[Points Earned] AS [Escalation?Assign]
, tblUpdateHeat.[Points Earned] AS UpdateHeat
, tblWorklog.[Points Earned] AS Worklog
FROM ((tblMonitoringData_OLD LEFT JOIN [tblEscalation/Assignment] ON
tblMonitoringData_OLD.[Escalation/Assignment] =
[tblEscalation/Assignment].ID)
LEFT JOIN tblUpdateHeat ON
tblMonitoringData_OLD.UpdateHeat = tblUpdateHeat.ID)
LEFT JOIN tblWorklog ON
tblMonitoringData_OLD.Worklog = tblWorklog.ID
Note that I have dropped the group by and changed DistinctRow to Distinct
dtretina wrote:
> if (Escalation/Assignment = 0) or (Updateheat = 0 )or (Worklog = 0), then 0
> for the total. Else total.
>
> How would you set this up in design query? Each of the above is a seperate
> table
>
> Query:
> SELECT DISTINCTROW tblMonitoringData_OLD.[HEAT ID],
> [tblEscalation/Assignment]![Points Earned]+tblUpdateHeat![Points
> Earned]+tblWorklog![Points Earned] AS [Documenation Pts],
> [tblEscalation/Assignment].[Points Earned] AS [Escalation?Assign],
> tblUpdateHeat.[Points Earned] AS UpdateHeat, tblWorklog.[Points Earned] AS
> Worklog
> FROM ((tblMonitoringData_OLD LEFT JOIN [tblEscalation/Assignment] ON
> tblMonitoringData_OLD.[Escalation/Assignment] =
> [tblEscalation/Assignment].ID) LEFT JOIN tblUpdateHeat ON
> tblMonitoringData_OLD.UpdateHeat = tblUpdateHeat.ID) LEFT JOIN tblWorklog ON
> tblMonitoringData_OLD.Worklog = tblWorklog.ID
> GROUP BY tblMonitoringData_OLD.[HEAT ID], [tblEscalation/Assignment].[Points
> Earned], tblUpdateHeat.[Points Earned], tblWorklog.[Points Earned];
>
--
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
|
|
0
|
|
|
|
Reply
|
John
|
6/7/2010 7:28:34 PM
|
|
You have the same names as calculated fields and fields that you are joining
tables on.
Which do you want to use in the IIF stateement?
--
Build a little, test a little.
"dtretina" wrote:
> if (Escalation/Assignment = 0) or (Updateheat = 0 )or (Worklog = 0), then 0
> for the total. Else total.
>
> How would you set this up in design query? Each of the above is a seperate
> table
>
> Query:
> SELECT DISTINCTROW tblMonitoringData_OLD.[HEAT ID],
> [tblEscalation/Assignment]![Points Earned]+tblUpdateHeat![Points
> Earned]+tblWorklog![Points Earned] AS [Documenation Pts],
> [tblEscalation/Assignment].[Points Earned] AS [Escalation?Assign],
> tblUpdateHeat.[Points Earned] AS UpdateHeat, tblWorklog.[Points Earned] AS
> Worklog
> FROM ((tblMonitoringData_OLD LEFT JOIN [tblEscalation/Assignment] ON
> tblMonitoringData_OLD.[Escalation/Assignment] =
> [tblEscalation/Assignment].ID) LEFT JOIN tblUpdateHeat ON
> tblMonitoringData_OLD.UpdateHeat = tblUpdateHeat.ID) LEFT JOIN tblWorklog ON
> tblMonitoringData_OLD.Worklog = tblWorklog.ID
> GROUP BY tblMonitoringData_OLD.[HEAT ID], [tblEscalation/Assignment].[Points
> Earned], tblUpdateHeat.[Points Earned], tblWorklog.[Points Earned];
>
|
|
0
|
|
|
|
Reply
|
Utf
|
6/7/2010 8:13:08 PM
|
|
|
2 Replies
1042 Views
(page loaded in 2.418 seconds)
Similiar Articles: in access, if then statement - microsoft.public.access.queries ...if (Escalation/Assignment = 0) or (Updateheat = 0 )or (Worklog = 0), then 0 for the total. Else total. How would you set this up in design quer... Access 2003 multiple if then statement help - microsoft.public ...Hello, I am having a problem constructing the proper clause for querying my database. I have multiple values used in computing daily averages of cons... If then statement?? - microsoft.public.access.queriesI am new to Access and am trying to take a field and change the value depending on what the current value is. example If [field 1] is 01 then "s... Iif then statement needed for Access 2007 please - microsoft ...Hi all, I'm trying to figure out how to write an Iif Then statement in access 2007 for: iif columnZ = 10 then columnZ = A please help, SQL a... If/then statement between dates - microsoft.public.access ...Hello. I am trying to draft an if/then statement that will pull a rate from a table and use it to multiply by a number from a different table. Table... If then statement in Visual Basic - microsoft.public.access ...If then statement in Visual Basic - microsoft.public.access ... Pass field value selected in Combo Box to SQL Query - microsoft ..... box populated by a SQL SELECT ... combo box value based on if - then statement - microsoft.public ...I have a unbound control on a form that calculates the Qty remaining on a PO release. In the subform I have an bound combobox (cboReleaseStatus) wi... If statement not displaying text if conditions not met - microsoft ...I want to do a calculation which calculates selling price from either Margin % or Margin £ and if there is nothing in either field then I want to dis... Report Sum/If Statement - microsoft.public.access.reports ...Iif then statement needed for Access 2007 please - microsoft ... Report Sum/If Statement - microsoft.public.access.reports ... Iif then statement needed for Access 2007 ... IIf Statement Error - microsoft.public.access.queriesI'm trying to formulate an if/then statement in a query and it returns with error as the value. I've a calculated expression as Expr2: Expr2: ... MS Access: IF-THEN-ELSE Statement - TechOnTheNet.comIn Access, the IF-THEN-ELSE statement can only be used in VBA code. Using the New Expression Builder to Build If-Then Statements in ...Summary: Use the improved Expression Builder to create a nested IIf expression in Access 2010. How to Write an If Statement in Access | eHow.com"If" statements can evaluate "true" or "false" conditions and perform actions based on those conditions. These statements can be broken down into two types: "If-Then ... MS Access: iif Function - TechOnTheNet.comIn Access, the iif function returns one value if a specified ... This is equivalent to the following IF statement in VBA code. If [Qty] > 10 Then If Then statement in Access or Excel - Microsoft AnswersWe enter data into Access, and then have a query bring data into Excel and update worksheet/charts. There are three (3) columns of data, numeric, that we have been ... 7/24/2012 1:12:25 PM
|