expression typed incorretly or too complex to be evaluated

  • Thread starter DOMIRICAN via AccessMonster.com
  • Start date
D

DOMIRICAN via AccessMonster.com

I have a problem with an error message.

The message I get is "the expression is typed incorrectly or too complex to
be evaluated"

It use to work before, not sure what happened!

HELP PLEASE!!!

PARAMETERS [forms]![PDate]![StartDate] DateTime;
TRANSFORM First(([se]/[downtime])) AS PP
SELECT ProductionQueryRpt.Department, ProductionQueryRpt.ProductionQueryRpt0.
Employee
FROM ProductionQueryRpt
WHERE (((ProductionQueryRpt.Active)=[Forms]![PDate]![active])) OR ((([Forms]!
[PDate]![active]) Is Null))
GROUP BY ProductionQueryRpt.Department, ProductionQueryRpt.
ProductionQueryRpt0.Employee, ProductionQueryRpt.Active
PIVOT "D" & DateDiff("d",Forms!PDate!StartDate,[PDate]) In ("d0","d1","d2",
"d3","d4","d5","d6")
WITH OWNERACCESS OPTION;
 
D

DOMIRICAN via AccessMonster.com

Here is my new sql:

PARAMETERS [forms]![PDate]![StartDate] DateTime, [forms]![PDate]![active]
Bit;
TRANSFORM First(([se]/[downtime])) AS PP
SELECT ProductionQueryRpt.Department, ProductionQueryRpt.ProductionQueryRpt0.
Employee
FROM ProductionQueryRpt
WHERE (((ProductionQueryRpt.Active)=[Forms]![PDate]![active])) OR ((([Forms]!
[PDate]![active]) Is Null))
GROUP BY ProductionQueryRpt.Department, ProductionQueryRpt.
ProductionQueryRpt0.Employee, ProductionQueryRpt.Active
PIVOT "D" & DateDiff("d",Forms!PDate!StartDate,[PDate]) In ("d0","d1","d2",
"d3","d4","d5","d6")
WITH OWNERACCESS OPTION;

I added that but it did not change anything!!
You don't have [Forms]![PDate]![active] in your parameters.
I have a problem with an error message.
[quoted text clipped - 17 lines]
"d3","d4","d5","d6")
WITH OWNERACCESS OPTION;
 
D

Duane Hookom

I'm not sure how this is possible since this expression is in your SELECT:
ProductionQueryRpt.ProductionQueryRpt0.Employee

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


DOMIRICAN via AccessMonster.com said:
Here is my new sql:

PARAMETERS [forms]![PDate]![StartDate] DateTime, [forms]![PDate]![active]
Bit;
TRANSFORM First(([se]/[downtime])) AS PP
SELECT ProductionQueryRpt.Department, ProductionQueryRpt.ProductionQueryRpt0.
Employee
FROM ProductionQueryRpt
WHERE (((ProductionQueryRpt.Active)=[Forms]![PDate]![active])) OR ((([Forms]!
[PDate]![active]) Is Null))
GROUP BY ProductionQueryRpt.Department, ProductionQueryRpt.
ProductionQueryRpt0.Employee, ProductionQueryRpt.Active
PIVOT "D" & DateDiff("d",Forms!PDate!StartDate,[PDate]) In ("d0","d1","d2",
"d3","d4","d5","d6")
WITH OWNERACCESS OPTION;

I added that but it did not change anything!!
You don't have [Forms]![PDate]![active] in your parameters.
I have a problem with an error message.

[quoted text clipped - 17 lines]
"d3","d4","d5","d6")
WITH OWNERACCESS OPTION;
 
D

DOMIRICAN via AccessMonster.com

I'm a newbie and don't quite understand what you're asking me. Here is my sql
from the ProductionQueryRpt: This report runs fine

PARAMETERS [forms]![pdate]![active] Text ( 255 );
SELECT DISTINCT ProductionQueryRpt0.Department, ProductionQueryRpt0.Employee,
ProductionQueryRpt0.ID, ProductionQueryRpt0.PDate, Sum(ProductionQueryRpt0.
[Earned Hr]) AS [SumOfEarned Hr], Sum(ProductionQueryRpt0.Station) AS
SumOfStation, Sum(ProductionQueryRpt0.project) AS SumOfproject,
ProductionQueryRpt0.Active, nz([break],0) AS Brk, ProductionQueryRpt1.tpaid,
ProductionQueryRpt1.tl, ProductionQueryRpt1.TOTALHR, [tpaid]-([Brk]+
[sumofStation]+[sumofproject]) AS DOWNTIME
FROM ProductionQueryRpt0 LEFT JOIN ProductionQueryRpt1 ON
(ProductionQueryRpt0.PDate = ProductionQueryRpt1.PDate) AND
(ProductionQueryRpt0.ID = ProductionQueryRpt1.ID)
GROUP BY ProductionQueryRpt0.Department, ProductionQueryRpt0.Employee,
ProductionQueryRpt0.ID, ProductionQueryRpt0.PDate, ProductionQueryRpt0.Active,
nz([break],0), ProductionQueryRpt1.tpaid, ProductionQueryRpt1.tl,
ProductionQueryRpt1.TOTALHR
HAVING (((ProductionQueryRpt0.Active)=[forms]![pdate]![active]));

I noticed that the problem is when I do the calculation of [sumofearned hr]/
[downtime] help!!!

PARAMETERS [forms]![PDate]![StartDate] DateTime;
TRANSFORM First([sumofearned hr]/[downtime]) AS PP
SELECT ProductionQueryRpt.Department, ProductionQueryRpt.ProductionQueryRpt0.
Employee
FROM ProductionQueryRpt
GROUP BY ProductionQueryRpt.Department, ProductionQueryRpt.
ProductionQueryRpt0.Employee, ProductionQueryRpt.Active
PIVOT "D" & DateDiff("d",Forms!PDate!StartDate,[PDate]) In ("d0","d1","d2",
"d3","d4","d5","d6")
WITH OWNERACCESS OPTION;

Please help!!!



Duane said:
I'm not sure how this is possible since this expression is in your SELECT:
ProductionQueryRpt.ProductionQueryRpt0.Employee
Here is my new sql:
[quoted text clipped - 20 lines]
 
D

Duane Hookom

I expect that Downtime might be either Null or 0 in some records.

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


DOMIRICAN via AccessMonster.com said:
I'm a newbie and don't quite understand what you're asking me. Here is my sql
from the ProductionQueryRpt: This report runs fine

PARAMETERS [forms]![pdate]![active] Text ( 255 );
SELECT DISTINCT ProductionQueryRpt0.Department, ProductionQueryRpt0.Employee,
ProductionQueryRpt0.ID, ProductionQueryRpt0.PDate, Sum(ProductionQueryRpt0.
[Earned Hr]) AS [SumOfEarned Hr], Sum(ProductionQueryRpt0.Station) AS
SumOfStation, Sum(ProductionQueryRpt0.project) AS SumOfproject,
ProductionQueryRpt0.Active, nz([break],0) AS Brk, ProductionQueryRpt1.tpaid,
ProductionQueryRpt1.tl, ProductionQueryRpt1.TOTALHR, [tpaid]-([Brk]+
[sumofStation]+[sumofproject]) AS DOWNTIME
FROM ProductionQueryRpt0 LEFT JOIN ProductionQueryRpt1 ON
(ProductionQueryRpt0.PDate = ProductionQueryRpt1.PDate) AND
(ProductionQueryRpt0.ID = ProductionQueryRpt1.ID)
GROUP BY ProductionQueryRpt0.Department, ProductionQueryRpt0.Employee,
ProductionQueryRpt0.ID, ProductionQueryRpt0.PDate, ProductionQueryRpt0.Active,
nz([break],0), ProductionQueryRpt1.tpaid, ProductionQueryRpt1.tl,
ProductionQueryRpt1.TOTALHR
HAVING (((ProductionQueryRpt0.Active)=[forms]![pdate]![active]));

I noticed that the problem is when I do the calculation of [sumofearned hr]/
[downtime] help!!!

PARAMETERS [forms]![PDate]![StartDate] DateTime;
TRANSFORM First([sumofearned hr]/[downtime]) AS PP
SELECT ProductionQueryRpt.Department, ProductionQueryRpt.ProductionQueryRpt0.
Employee
FROM ProductionQueryRpt
GROUP BY ProductionQueryRpt.Department, ProductionQueryRpt.
ProductionQueryRpt0.Employee, ProductionQueryRpt.Active
PIVOT "D" & DateDiff("d",Forms!PDate!StartDate,[PDate]) In ("d0","d1","d2",
"d3","d4","d5","d6")
WITH OWNERACCESS OPTION;

Please help!!!



Duane said:
I'm not sure how this is possible since this expression is in your SELECT:
ProductionQueryRpt.ProductionQueryRpt0.Employee
Here is my new sql:
[quoted text clipped - 20 lines]
"d3","d4","d5","d6")
WITH OWNERACCESS OPTION;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top