Skip to main content
Solved

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

  • August 30, 2023
  • 1 reply
  • 86 views

Forum|alt.badge.img

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")
)

Best answer by Luçjano Capo

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.

This topic has been closed for replies.

1 reply

Luçjano Capo
Forum|alt.badge.img
  • Employee
  • Answer
  • September 15, 2023

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.