Skip to main content

A follow up to my previous post:  Using multiple CTEs in Tableau | Salesforce Trailblazer Community

 

 

I now have to add 2 temporary variables, a start_date and end_date.  The code works w/ 1 temporary variable but fails when I add a second temporary variable.  The error message I receive says  

 

Actual statement count 3 did not match the desired statement count 1. 

Initial SQL Error. Check that the syntax is correct and that you have access privileges to the requested database. 

 

This is my code.  Would appreciate any help.  Thank you!

 

SET START_DATE = '2026-08-31'::DATE;

SET END_DATE = '2026-09-05'::DATE;

 

CREATE TEMPORARY TABLE AAAA_DB.AAAA_TB.test1 AS 

 

WITH RECURSIVE

business_dates (business_date) AS (

    SELECT $BUSINESS_START_DATE::DATE

    UNION ALL

    SELECT DATEADD(day, 1, business_date)

    FROM business_dates

    WHERE business_date < $BUSINESS_END_DATE::DATE

),

followed by multiple CTEs

 

#Tableau Desktop & Web Authoring

0/9000