I created a working Union within a query.
SELECT tblGlass.Address, tblGlass.Quantity, tblGlass.Width, tblGlass.Height,
tblGlass.Thickness, tblGlass.Finish
FROM tblGlass
WHERE tblGlass.Ordered=No;
UNION SELECT tblSeansGlass.Address, tblSeansGlass.Quantity,
tblSeansGlass.Width, tblSeansGlass.Height, tblSeansGlass.Thickness,
tblSeansGlass.Finish
FROM tblSeansGlass
WHERE tblSeansGlass.Ordered=No;
I would now like to add a module to both tables which works out a price:
GlassPrice([Width],[Height],[Thickness],[Quantity],[Finish]) AS [Glass Price]
So the final code looks like this:
SELECT tblGlass.Address, tblGlass.Quantity, tblGlass.Width, tblGlass.Height,
tblGlass.Thickness, tblGlass.Finish, GlassPrice([Width],[Height],
[Thickness],[Quantity],[Finish]) AS [Glass Price]
FROM tblGlass
WHERE tblGlass.Ordered=No;
UNION SELECT tblSeansGlass.Address, tblSeansGlass.Quantity,
tblSeansGlass.Width, tblSeansGlass.Height, tblSeansGlass.Thickness,
tblSeansGlass.Finish, GlassPrice([Width],[Height],[Thickness],[Quantity],
[Finish]) AS [Glass Price]
FROM tblSeansGlass
WHERE tblSeansGlass.Ordered=No;
However, I get an error:
"Data type mismatch in criteria expression."
Thanks to Andre's comment I found the source of the problem to be a half filled entry in tblSeansGlass. Deleting this entry solved the problem. Thanks again Andre!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.