Page 1 of 1

Query Issue

Posted: Fri Feb 06, 2026 5:51 pm
by JohnW
This query runs fine in SQL Server Manager but fails in Stimulsoft. Any idea why. It gives a data mismatch error, which is not seen in SQL Server Management. I have tried numerous variations of the query. They all fail. The goal is to get a valid sort on a string of this type AGEAGE000028899, AGEAGE000028607, etc

Thanks John W
------------

Code: Select all

select OnlineRenewalBuyersCard.LicenseeName,OnlineRenewalBuyersCard.Iden,OnlineRenewalBuyersCard.PermitTypeFee,OnlineRenewalBuyersCard.permitNumber, permitTypeCode, OnlineRenewalBuyersCard.invoiceKey, Cast(transactionDate As Date) AS TransactionDate, 
	RemittanceDetail.transactionConfirmationID,RemittanceDetail.AmountDue,Cast(RemittanceDetail.PaymentEffectiveDate AS Date) AS PaymentEffectiveDate,RemittanceDetail.invoicekey as remitInvoice 
from OnlineRenewalBuyersCard 
left join RemittanceDetail on OnlineRenewalBuyersCard.invoiceKey = remittanceDetail.InvoiceKey
where 
transactionDate between @dateFrom and @dateTo
AND OnlineRenewalBuyersCard.PermitStatus <> 'Void'
ORDER BY TRY_CAST(
    RIGHT(
        remittanceDetail.transactionConfirmationID,
        LEN(remittanceDetail.transactionConfirmationID) 
        - NULLIF(PATINDEX('%[^0-9]%', remittanceDetail.transactionConfirmationID), 0) + 1
    ) AS INT
)

Re: Query Issue

Posted: Fri Feb 06, 2026 6:04 pm
by Lech Kulikowski
Hello,

Does the issue occur without @dateFrom and @dateTo parameters?

Thank you.

Re: Query Issue

Posted: Fri Feb 06, 2026 7:40 pm
by JohnW
I have been able to get it run. What I find is the order by is failing. When I view the data in Stimulsoft query editor it show the sort working. When I see the data in the report it is lost.

See image:

Re: Query Issue

Posted: Mon Feb 09, 2026 7:06 pm
by Lech Kulikowski
Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.

Re: Query Issue

Posted: Wed Feb 11, 2026 3:57 pm
by JohnW
Is there a way to include the sample data with the report. Currently the data sits in a SQL Server db without external access.

Re: Query Issue

Posted: Wed Feb 11, 2026 9:47 pm
by Lech Kulikowski
Hello,

In the Dictionary, you can use Actions - Embed all data resources option.

Thank you.