从Access DB中的两个表中拉出 [英] Pulling from two tables in Access DB

查看:90
本文介绍了从Access DB中的两个表中拉出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello guts我试图从AccessDB中的两个表中提取数据,但是我遇到错误语法错误与* FROM CLAWS *

查找下面是我的代码请记住startTime和EndTime来自CompletedFormulas表。感谢您提前获得指导。

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.

"SELECT IngredientLotId1, IngredientName, ActualWeight,TargetWeight, (ActualWeight-TargetWeight )AS VARIANCE,(0.04*TargetWeight )AS TOLERANCE , StartTime, EndTime FROM CompletedIngredients  INNER JOIN CompletedFormulas WHERE RecordNumber=RecordNumber ";

推荐答案

MS Access数据库引擎确实喜欢使用别名:



MS Access database engine does like to use aliases:

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.


这篇关于从Access DB中的两个表中拉出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆