Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mikejohnson
Posting Yak Master
153 Posts |
Posted - 2004-03-22 : 18:19:48
|
i get this error:This expression is typed incorrectly, or it is too complex to be evaluated. For example, ......here is my query:SELECT DISTINCTROW qryrCrustProductionRecap.ShiftDate, qryrCrustProductionRecap.Shift, qryrCrustProductionRecap.JulianDate, qryrCrustProductionRecap.Product, [TotalEaches]+[TotalSamples] AS TotalEachesWQA, qryrCrustProductionRecap.TotalEaches AS WithoutQA, qryrCrustProductionRecap.TotalCases, qryrCrustProductionRecap.RunTimeText, qryrCrustProductionRecap.RunTimeCalc, CInt([TotalEaches]/[RunTimeCalc]) AS RunSpeed, qryrCrustProductionRecap.TotalScrapEA, [TotalScrapEA]/([TotalEaches]) AS [CrustWasted%], qryrCrustProductionRecap.TotalCrustLnDbll, [TotalCrustLnDbll]/([TotalEaches]) AS [DBWasted%], qryrCrustProductionRecap.CrustLabor, [CrustLabor]*[forms]![fmnReportMenu]![txtDirectLaborCost] AS PerHrCrustLabor, ([CrustLabor]*[forms]![fmnReportMenu]![txtDirectLaborCost])/([TotalEaches]) AS CrustLaborCst, qryrCrustProductionRecap.CrustRmEmployees, qryrCrustProductionRecap.D_SFTFROM qryrCrustProductionRecapWHERE[D_SFT] BETWEEN #2/1/2004# AND #2/2/2004# |
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2004-03-23 : 13:28:12
|
Mike,I've run into this sort of problem before, where Access will just choke on something. There are a couple of approaches I've taken before. One is to just pare down the columns to as few as I can get away with. Another is to build smaller queries that contain some of your formulae and then build your "final" query by referencing those other queries.Looking specifically at your query, I see that you have a column qryrCrustProductionRecap.TotalEaches that you are aliasing as WithoutQA, but then in several other places you are referring to [TotalEaches]. Are these the same columns? If so, you might try just removing the alias, or instead, using the alias in the other formulae and see if that helps.--------------------------------------------------------------Find more words of wisdom at [url]http://weblogs.sqlteam.com/markc[/url] |
 |
|
|
|
|
|
|