From: relativehunter on
I changed the update query to fill in the same time in both begin and end, so
that end had a non-null time. Got the same exact message. Simplifying the
query does not seem to be necessary, since when the Paper form is not open,
the query runs fine. Seems to be some kind of interaction between the two
open objects.

"Daryl S" wrote:

> Relativehunter -
>
> Can your Start or End values in the table be null? If so, you need to
> address that. I assume if they are null, then you don't have a Total time
> for those records, and they should be exluded (see the WHERE clause below).
>
> Also, I assume the form's Start and End fields are true dates. If your
> table Start and End fields are true date/time fields, then simplify the query:
>
> SELECT Sum(Times.[Total time]) AS [Sum Of Total time],
> [Forms]![Times]![Start] AS Start, [Forms]![Times]![End] AS [End]
> FROM Times
> WHERE (((Times.[Start])>=[Forms]![Times]![Start]) AND
> ((DateValue(Times.[End]))<=[Forms]![Times]![End]))
> GROUP BY [Forms]![Times]![Start], [Forms]![Times]![End]
> WHERE [Start] is not null and [End] is not null;
>
> --
> Daryl S
>
>
> "relativehunter" wrote:
>
> >
> > The message specifically is "The expression is typed incorrectly, or it is
> > too complex to be evaluated." And gives an example.
> >
> > The query is: SELECT Sum(Times.[Total time]) AS [Sum Of Total time],
> > [Forms]![Times]![Start] AS Start, [Forms]![Times]![End] AS [End]
> > FROM Times
> > WHERE (((DateValue([Start]))>=DateValue([Forms]![Times]![Start])) AND
> > ((DateValue([End]))<=DateValue([Forms]![Times]![End])))
> > GROUP BY [Forms]![Times]![Start], [Forms]![Times]![End];
> > I have a form to select the beginning and ending dates.
From: Daryl S on
Relativehunter -

Can your Start or End values in the table be null? If so, you need to
address that. I assume if they are null, then you don't have a Total time
for those records, and they should be exluded (see the WHERE clause below).

Also, I assume the form's Start and End fields are true dates. If your
table Start and End fields are true date/time fields, then simplify the query:

SELECT Sum(Times.[Total time]) AS [Sum Of Total time],
[Forms]![Times]![Start] AS Start, [Forms]![Times]![End] AS [End]
FROM Times
WHERE (((Times.[Start])>=[Forms]![Times]![Start]) AND
((DateValue(Times.[End]))<=[Forms]![Times]![End]))
GROUP BY [Forms]![Times]![Start], [Forms]![Times]![End]
WHERE [Start] is not null and [End] is not null;

--
Daryl S


"relativehunter" wrote:

>
> The message specifically is "The expression is typed incorrectly, or it is
> too complex to be evaluated." And gives an example.
>
> The query is: SELECT Sum(Times.[Total time]) AS [Sum Of Total time],
> [Forms]![Times]![Start] AS Start, [Forms]![Times]![End] AS [End]
> FROM Times
> WHERE (((DateValue([Start]))>=DateValue([Forms]![Times]![Start])) AND
> ((DateValue([End]))<=DateValue([Forms]![Times]![End])))
> GROUP BY [Forms]![Times]![Start], [Forms]![Times]![End];
> I have a form to select the beginning and ending dates.
From: Daryl S on
Relativehunter -

You talk about the Paper form, but your query uses data from the Times form.
Could this be your problem?

Should [Forms]![Times]![Start] be [Forms]![Paper]![Start], etc.?

--
Daryl S


"relativehunter" wrote:

> I changed the update query to fill in the same time in both begin and end, so
> that end had a non-null time. Got the same exact message. Simplifying the
> query does not seem to be necessary, since when the Paper form is not open,
> the query runs fine. Seems to be some kind of interaction between the two
> open objects.
>
> "Daryl S" wrote:
>
> > Relativehunter -
> >
> > Can your Start or End values in the table be null? If so, you need to
> > address that. I assume if they are null, then you don't have a Total time
> > for those records, and they should be exluded (see the WHERE clause below).
> >
> > Also, I assume the form's Start and End fields are true dates. If your
> > table Start and End fields are true date/time fields, then simplify the query:
> >
> > SELECT Sum(Times.[Total time]) AS [Sum Of Total time],
> > [Forms]![Times]![Start] AS Start, [Forms]![Times]![End] AS [End]
> > FROM Times
> > WHERE (((Times.[Start])>=[Forms]![Times]![Start]) AND
> > ((DateValue(Times.[End]))<=[Forms]![Times]![End]))
> > GROUP BY [Forms]![Times]![Start], [Forms]![Times]![End]
> > WHERE [Start] is not null and [End] is not null;
> >
> > --
> > Daryl S
> >
> >
> > "relativehunter" wrote:
> >
> > >
> > > The message specifically is "The expression is typed incorrectly, or it is
> > > too complex to be evaluated." And gives an example.
> > >
> > > The query is: SELECT Sum(Times.[Total time]) AS [Sum Of Total time],
> > > [Forms]![Times]![Start] AS Start, [Forms]![Times]![End] AS [End]
> > > FROM Times
> > > WHERE (((DateValue([Start]))>=DateValue([Forms]![Times]![Start])) AND
> > > ((DateValue([End]))<=DateValue([Forms]![Times]![End])))
> > > GROUP BY [Forms]![Times]![Start], [Forms]![Times]![End];
> > > I have a form to select the beginning and ending dates.