Problems with calculated field

Carrie

Active Member
Joined
Nov 20, 2002
Messages
418
Here is the SQL I have so far.

SELECT [Qry - First Inbound Activity <=15 Min from Open].[Functional Sub Area], [Qry - First Inbound Activity <=15 Min from Open].[SR #], [Qry - First Inbound Activity <=15 Min from Open].[Agent Opened Date], [Qry - First Inbound Activity <=15 Min from Open]!FirstOfCreated<[Qry - Outbound Activities]!Created AS [Outbound after First Inbound], [Qry - Outbound Activities].[Agent Closed Date], [Qry - Outbound Activities].Type
FROM ([Qry - First Inbound Activity <=15 Min from Open] INNER JOIN [Qry - Outbound Activities] ON [Qry - First Inbound Activity <=15 Min from Open].[SR #] = [Qry - Outbound Activities].[SR #]) INNER JOIN [Qry - First Inbound Activity <=15 Min from Open] AS [Qry - First Inbound Activity <=15 Min from Open_1] ON [Qry - Outbound Activities].[SR #] = [Qry - First Inbound Activity <=15 Min from Open_1].[SR #]
GROUP BY [Qry - First Inbound Activity <=15 Min from Open].[Functional Sub Area], [Qry - First Inbound Activity <=15 Min from Open].[SR #], [Qry - First Inbound Activity <=15 Min from Open].[Agent Opened Date], [Qry - Outbound Activities].[Agent Closed Date], [Qry - Outbound Activities].Type;


The problem is with the Field named: Outbound after first Inbound.

All I need is for the data to show if the Created field from the table Qry - Outbound is greater than the First of Created field from the Qry - First Inbound Activity <=15 Min from Open table (both tables are actually queries as indicated by the Qry).

I have that in here as:

Outbound after First Inbound: [Qry - First Inbound Activity <=15 Min from Open]!FirstOfCreated<[Qry - Outbound Activities]!Created

When I run it I get the error:

You tried to execute a query that does not inclued the specified expression '[Qry - First Inbound Activity <=15 Min from Open]!FirstOfCreated<[Qry - Outbound Activities]!Created' as part of an aggregate function.

Please help, I am an Access dummy but am trying to learn with the help files. I have been working on this one project for four days and am stuck here.

:rolleyes:
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I believe your expression, as written should return a True or False (or 0 and -1).

If you want to return a value based on a condition, use an Immediate If statement, which has this format:

IIF(condition,what to return if condition is true, what to return if condition is false)

A simple example:
This will compare Field1 and Field2. If Field1 is bigger, it will return Field1. Otherwise it will return 0.
IIF(Field1 > Field2, Field1, 0)
 
Upvote 0
Yeah...I tried that the only thing is I don't want the zero's to show.

I want it to only show the values of [Qry - Outbound Activities]!Created>[Qry - First Inbound Activity <=15 Min from Open]!FirstOfCreated
 
Upvote 0
UGH!

WHAT DOES IT MEAN...I DON'T HAVE A SPECIFIED EXPRESSION?

Sorry, but I am getting a little frustrated with this. I am grimacing at my pc.

Ok...I tried this Outbound after First Inbound: IIf([Qry - First Inbound Activity <=15 Min from Open]![FirstOfCreated]<[Qry - Outbound Activities]![Created],[Qry - Outbound Activities]![Created],"False").

And got the same message.
 
Upvote 0
Are all your values in the two fields you are comparing date/numeric, or may the be text or blank? If they can be text or blank, it probably doesn't like doing the ">" command on them. We should be able to work around that, though.
 
Upvote 0
What are the Data Types for your two fields?
[Qry - First Inbound Activity <=15 Min from Open]![FirstOfCreated]
and
[Qry - Outbound Activities]![Created]

What are some of the values in these fields?
 
Upvote 0

Forum statistics

Threads
1,221,827
Messages
6,162,200
Members
451,753
Latest member
freddocp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top