I can’t explain why “filtering” the Customer table with a specified constant would provide results where unfiltered it claims it is a bad SQL statement.
The problem is, I don’t want to query one CustID at a time… I need to see all, so filtering (although works) isn’t the goal.
EDIT: just noticed you’re trying to join the UD.Num field to CustID, which is a string field. Are all of your CustID’s numeric? If not, you gotta handle that in the table filters or your query will blow up.
Better solution is to use a UD.Char field to store your CustID foreign key instead. Match the system data types, not just whatever business practice your company follows today.
I vaguely recall an Epicor Idea of adding additional UD table fields that are integers (but still keeping Number01 also). Seems like a common need (like here).
The Customer Account isn’t a key field. The legacy data is based on Sales Orders, so the keys are based on order number, line, release, etc. Customer account is just a field on the record.
Converting the Number03 to nvarchar resulted in an okay SQL statement, but for some reason resulted in 0 rows.
Natively, the BAQ will join the Number03 and the CustID… (without converting/casting)… but only if the CustID is filtered. That’s why I’m trying to determine why that is the case. Is it converting the CustID to a different “type” when applying a specific constant filter?
Looks like you can add a UD column to a UD table also and define as integer not decimal.
Never thought or needed to try, but out of curiosity I just did.
Yes, I’ve attempted to cast both sides of the join to the same thing… but not getting any results unless I add the filter.
So, even if I cast both values to integer it won’t produce results… unless I add the filter, and then it will give results. I just can’t find a way to do this “unfiltered”.
Maybe I’ll have to wipe my UD table and start over by importing the account numbers as strings.
Well I’ll tell you what, I am at a loss here. I was going to explain something and then ran into some weirdness.
Number01 (etc.) in all my UD tables are decimals (as we’ve discussed at length already), yet come across as single-digit integers. It’s preventing me from entering more digits into the field in an updatable BAQ. I can change the output format, but why is the BAQ being all funky?
Setting the UD Table as the 1st Table in the TopLevel query and then using a Right Outer Join seems to work. I am joining UD11 with Key2 (PONum) to POHeader. Key2 is cast as an integer. Returns all POHeader records without having to use a filter.