accessaspire219
Registered User.
- Local time
- Today, 00:48
- Joined
- Jan 16, 2009
- Messages
- 126
Hi,
I have a query which works off of objects I do not own. The field that I would like to join is in text format in one source while it is in the numerical format in the other source. I want to convert it into the same format so that I can join the two fields. Here is the SQL I am using
I get an error saying "You tried to execute a query that does not include CLng(Input.Material) as a part of an aggregate function. Can any help me find what is wrong in my code?
Also, I would like the inner join to be on two fields as follows
Input.Material=MARCBES.MATNR and
Input.Plant=MARCBES.WERKS
How do I incorporate this into the code?
Any help is appreciated.
Thanks!
I have a query which works off of objects I do not own. The field that I would like to join is in text format in one source while it is in the numerical format in the other source. I want to convert it into the same format so that I can join the two fields. Here is the SQL I am using
Code:
SELECT*
FROM
(SELECT CLng(Input.Material) AS Material, Input.Plant, Sum([Quantity]/[SUMREZ]) AS QTY_SUOM, Input.PurUOM, MARCBES.SOBSL, Input.PurchGrp
FROM Input) AS Input
INNER JOIN
(SELECT CLng(MATNR) AS MATERIAL_ID FROM MARCBES) AS MARCBES
ON Input.Material = MARCBES.MATERIAL_ID;
Also, I would like the inner join to be on two fields as follows
Input.Material=MARCBES.MATNR and
Input.Plant=MARCBES.WERKS
How do I incorporate this into the code?
Any help is appreciated.
Thanks!