Solved

PIVOT queries in SQL - works in FDConnection but NOT in FDQuery - why?

  • 30 August 2023
  • 1 reply
  • 60 views

Badge

Here is a simple example of a query that works in FDConnection but not FDQuery.  This was tested on the 30 row Excel table using the CDataExcel driver id.  The first component returns a 30 row result set.  The second component fails on “field 2023-01 not found in subquery ….”

select "Budgeted Items", "2023-01", "2023-02", "2023-03", "2023-04", "2023-05", "2023-06", "2023-07", "2023-08", "2023-09", "2023-10", "2023-11", "2023-12"  
from
(
  select "Budgeted Items", "MonthNo", "Amount" 
  from "BUDGETED"
) as SourceTable
PIVOT
(
  sum("Amount")
  for
  "MonthNo" in ("2023-01", "2023-02", "2023-03", "2023-04", "2023-05", "2023-06", "2023-07", "2023-08", "2023-09", "2023-10", "2023-11", "2023-12")
)

icon

Best answer by Luçjano Capo 15 September 2023, 12:12

View original

1 reply

Userlevel 7
Badge

Hi @Gator,

 

Your case is currently being handled by our support team. A ticket has filed to the development team and they are working on a solution.

 

We will keep you posted.

Reply