Click here to Skip to main content
15,917,174 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello guts I am trying to pull data from two table in an AccessDB,but am having error " syntax errror with *FROM CLAWS*"
Find below is my code keep in mind the startTime and EndTime are from CompletedFormulas Table .Thanks for your guidance in advance.
C#
"SELECT IngredientLotId1, IngredientName, ActualWeight,TargetWeight, (ActualWeight-TargetWeight )AS VARIANCE,(0.04*TargetWeight )AS TOLERANCE , StartTime, EndTime FROM CompletedIngredients  INNER JOIN CompletedFormulas WHERE RecordNumber=RecordNumber ";
Posted

1 solution

MS Access database engine does like to use aliases:

SQL
SELECT t1.IngredientLotId1, t1.IngredientName, t1.ActualWeight, t1.TargetWeight, (t1.ActualWeight- t1.TargetWeight )AS VARIANCE, (0.04* t1.TargetWeight )AS TOLERANCE , t2.StartTime, t2.EndTime
FROM CompletedIngredients As t1 INNER JOIN CompletedFormulas As t2 ON t1.RecordNumber=t2.RecordNumber 


Change the code to your needs.
 
Share this answer
 
Comments
Ekona_Pikin 1-Apr-15 9:39am    
A Coding Guru amongst us everyday learners thanks sir Maciej:))
Maciej Los 1-Apr-15 14:40pm    
Thank you and you're very welcome ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900