Not sure if this is the right channel... need assi...
# suiteanalytics
k
Not sure if this is the right channel... need assistance with suiteql. I need to do a Union ALL because I'm running into issues when doing it through MSSQL linked server. I used the remote library to find out you can do CTEs, but I'm getting this error:
Copy code
Search error occurred: Unsupported type: class com.netledger.sqlquery.model.SqlFactoredSourceReference : VendorBillCredits
I was getting a different error earlier, so I tried to just get it going with a single query first... first query is:
Copy code
WITH 
	VendorBillCredits AS 
(
SELECT 
	Transaction.TranID,
	Transaction.ID,
	Transaction.TranDate,
	Transaction.Type AS MainType,
	BUILTIN.DF( Transaction.Type ) AS Type,
	BUILTIN.DF( Transaction.Status ) AS Status,
	Transaction.custbodyorderno_gs,
        Transaction.custbody_avalara_doc_code as Avalara_Doc_Code,
        Transaction.custbody_avalara_transaction_id as Avalara_Doc_ID,
        BUILTIN.DF(postingperiod) AS AccountingPostingPeriod,
	ForeignTotal as PaymentAmount,
	ForeignPaymentAmountUsed as DepositUsed,
	Transaction.custbody_accounting_reviewed,
	Transaction.custbody_accounting_line_review,
	Transaction.custbody_accounting_fulfillment_review

FROM
	Transaction
WHERE
	Transaction.RecordType IN ('vendorcredit')
AND ( Transaction.TranDate >= TO_DATE('2021-01-01', 'YYYY-MM-DD' ) )
)

SELECT 
* 
FROM 
(SELECT * FROM VendorBillCredits)
and as I posted this I thought to try something. Turns out you cant star select it , defining the columns when querying the cte works -_-
n
@Kevin Weitzner appreciate you posted this a couple weeks ago but for future reference there's a suiteql channel 🙂