Query saves - Won't run (1 Viewer)

sportsguy

Finance wiz, Access hack
Local time
Yesterday, 23:31
Joined
Dec 28, 2004
Messages
363
Error message is

3125 - 'apFINISHED_EROSION MTD' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.

I have saved the query with different names,
the query used to run, now it won't run no matter what way i try. . .

Access 2007. . ..

any suggestions?

thanks in advance

sportsguy
 

boblarson

Smeghead
Local time
Yesterday, 20:31
Joined
Jan 12, 2001
Messages
32,059
Error message is

3125 - 'apFINISHED_EROSION MTD' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.

I have saved the query with different names,
the query used to run, now it won't run no matter what way i try. . .

Access 2007. . ..

any suggestions?

thanks in advance

sportsguy

Sounds like it could be some corruption. I've had that before. What happens if you IMPORT (not copy and paste) EVERYTHING into a new, blank database shell?

Or, before you do that - try DECOMPILING and then recompile.
 

sportsguy

Finance wiz, Access hack
Local time
Yesterday, 23:31
Joined
Dec 28, 2004
Messages
363
Copied the SQL text from the "corrupted" database and pasted into a new query in a new database with minimal code and the one form and one query other than this query.

still get the same answer. . .

3125 - ' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.

Let me try the decompile and recompile. . . i have never done that before. . .
this will be interesting.

thanks

sportsguy
 

boblarson

Smeghead
Local time
Yesterday, 20:31
Joined
Jan 12, 2001
Messages
32,059
If that doesn't work can you paste the SQL here?
 

sportsguy

Finance wiz, Access hack
Local time
Yesterday, 23:31
Joined
Dec 28, 2004
Messages
363
INSERT INTO FINISHED_EROSION ( strDistrict, CommonName, strProject, System, prjDescription, Family, Product, CommonProduct, Promo, Project_Start_Date, Finished_Date, Project_End_Date, Finish_Period, Customer_Number, BillTo, SalesType, Scope, ExpandedVM, Face_Price, Total_Actual, Total_Original, Total_Variance, Labor_Variance, Material_Variance, Subcontract_Variance, Sundry_Variance, RegionID, OperationID )
SELECT CTC_FINISHED.strDistrict, DISTRICTS.CommonName, CTC_FINISHED.strProject, CTC_FINISHED.System, PROJECTMASTER.prjDescription, PRODUCT_CODES.FADescription, CTC_FINISHED.Family, PRODUCT_CODES.CommonProduct, IIf(IsNull([Promotion_Code]),"",[Promotion_Code] & " - " & [NationalAccountName]) AS Promo, CTC_FINISHED.Project_Start_Date, CTC_FINISHED.Finished_Date, CTC_FINISHED.Project_End_Date, CTC_FINISHED.Fiscalperiod AS Finish_Period, CTC_FINISHED.Customer_Number, CTC_FINISHED.Customer_Name AS BillTo, SALESTYPE_CODES.SalesType, SCOPE_CODES.ScopeType, VERTICAL_CODES.ExpandedVM, [System_face_price]*[US$Rate] AS Face_Price, [Total_Actual_Costs]*[US$Rate] AS Total_Actual, [Total_original_estimated]*[US$Rate] AS Total_Original, ([Total_original_estimated]-[Total_Actual_Costs])*[US$Rate] AS Total_Variance, ([Labor_original_estimated_dollars]-[Labor_Actual_Dollars])*[US$Rate] AS Labor_Variance, ([Material_Original_estimated_dollar]-[Material_Actual_Cost])*[US$Rate] AS Material_Variance, ([Subcontracting_Original_estimated_dollar]-[Subcontracting_Actual_Cost])*[US$Rate] AS Subcontract_Variance, ([Sundry_Original_estimated_dollar]-[Sundry_Actual_Cost])*[US$Rate] AS Sundry_Variance, DISTRICTS.RegionID, Left([DISTRICTS].[RegionID],2) AS Op
FROM ((((((((CTC_FINISHED INNER JOIN DISTRICTS ON CTC_FINISHED.strDistrict = DISTRICTS.strDistrict) INNER JOIN VERTICAL_CODES ON CTC_FINISHED.Vertical_Market = VERTICAL_CODES.VMID) INNER JOIN PRODUCT_CODES ON CTC_FINISHED.Family = PRODUCT_CODES.ProdID) INNER JOIN REGION ON DISTRICTS.RegionID = REGION.RegionID) INNER JOIN FX ON DISTRICTS.Currency = FX.Currency) INNER JOIN PROJECTMASTER ON CTC_FINISHED.strProject = PROJECTMASTER.strProject) LEFT JOIN NATACCTS ON CTC_FINISHED.Promotion_Code = NATACCTS.NatAcctID) LEFT JOIN SCOPE_CODES ON PROJECTMASTER.[T$SCOP] = SCOPE_CODES.strScope) LEFT JOIN SALESTYPE_CODES ON PROJECTMASTER.strSALESTYPE = SALESTYPE_CODES.strType
WHERE (((CTC_FINISHED.Fiscalperiod)=[Forms]![Home].[cboYYYYMM]) AND ((FX.Year)=Int([Forms!Home.cboYYYYMM]/100)) AND ((Abs([System_face_price])+Abs([Total_Actual_Costs]))>2));
 

sportsguy

Finance wiz, Access hack
Local time
Yesterday, 23:31
Joined
Dec 28, 2004
Messages
363
I had to rebuild the query from scratch in the new database. . .
works again. . . works now. . . though must be some sort of corruption.

Have been meaning to productionize this database so that its fully button operated with all coding. . . partly done now. . .

thanks

sportsguy
 

Users who are viewing this thread

Top Bottom