I have a weird sql result. This query works fine. ...
# suiteql
c
I have a weird sql result. This query works fine.
Copy code
select t.id, t.createddate, cc.transactionline, cc.standardcost
from transaction t
	inner join TransactionAccountingLineCostComponent cc on cc.transaction = t.id
where t.id = 84064869
	and t.recordtype = 'inventorycostrevaluation'
It returns this:
Copy code
[
     {
          "id": 84064869,
          "createddate": "4/29/2025",
          "transactionline": 1,
          "expr1": 160.54666055666667
     },
     {
          "id": 84064869,
          "createddate": "4/29/2025",
          "transactionline": 2,
          "expr1": 160.37890055666668
     }
]
If I add a
where
clause condition like this
and cc.transactionline = 2
I get no results. The data is clearly there, why won't it filter on results that are readily available?
Eek.. just had to rubber duck it here.
BUILTIN.DF()
works!
a
can you put the working query syntax here please? I thought that builtin stuff was just for how things are output, didn't realize it would effect where clauses
c
Copy code
select t.id, t.createddate, cc.transactionline, cc.standardcost
from transaction t
	inner join TransactionAccountingLineCostComponent cc on cc.transaction = t.id
where t.id = 84064869
	and t.recordtype = 'inventorycostrevaluation'
    and BUILTIN.DF(cc.transactionline) = 2
For some reason the DB doesn't see the 2 as a 2. It sees something else...
a
oh can you try
and cc.transactionline = '2'
without the builtin?
c
Doesn't work
a
very interesting, thanks for sharing
👍🏻 1