Rik
(Richard Hodges)
November 18, 2019, 11:28am
1
Hi
I’m trying to make a recursive CTE but I’m not sure how to get the CTE to reference itself (the UNION ALL statement and the code underneath that references to first block).
I’ve heard it’s possible to do in E10 but I can’t find any examples. Is it done differently in a BAQ?
Any help would be greatly appreciated!
Cheers
josecgomez
(Jose C Gomez)
November 18, 2019, 12:01pm
2
F1 (Help) in the baq screen has a very thorough example of how to do this and generate a multi level bom
2 Likes
Rik
(Richard Hodges)
November 18, 2019, 4:03pm
3
Apologies I’ve looked through the help files but I can’t find an example that helps me with this problem. I’ve been looking through:
Epicor ERP User Guides > Tools User Guide > Business Activity Queries section
Am I looking in the right place?
josecgomez
(Jose C Gomez)
November 18, 2019, 6:06pm
5
It’s in the Epicor Help F1 (File -> Help)
bordway
(Bruce Ordway)
November 18, 2019, 6:14pm
6
You could try the search word indented…
The list returned should include a few threads that discuss the indenting of BOMs which might get you started.
e.g. here is one link:
So to go along with my post a couple of days ago about the Method Master, (Indented Bill of Operations - ERP 10 - Epicor User Help Forum ) I’m trying to write my own SQL query for BOM Listing. It will be much cleaner and just provide me with the information I need versus the report.
I have for the most part my multi level query written out and working properly except for one little thing. My where clause is currently around PartRev.Approved = true or null. This works great for probably 95% of th…
2 Likes
Rik
(Richard Hodges)
November 19, 2019, 9:37am
7
Thanks! I’ve followed the instructions but I’m getting a syntax error with the indent columns, the help files say to add this code:
cast ( substring(’…’,1 ,(Hierarchy + 1) ) + PartMtl.MtlPartNum as nvarchar(25))
But it says Incorrect syntax near ‘…’. Is the ‘…’ supposed to be an expression?
knash
(Ken Nash)
November 19, 2019, 1:31pm
8
The ‘…’ creates the indented look, that is needed.
Do you have the Hierarchy column created?
1 Like
Rik
(Richard Hodges)
November 19, 2019, 1:53pm
9
I do have the Hierarchy column created
Are the apostrophe’s the “straight” kind or the smart kind?
1 Like
knash
(Ken Nash)
November 19, 2019, 2:32pm
11
Would you be able to copy and paste the query phrase. That will help us see where the issue might be.