SQL from "EventCalendar" - Forge

Hello, 

I'm trying to implement this forge application, and replicating the preparation "EventCalendar", but I'm having trouble understanding this syntax. 
And This error appears. 

What should I do to solve?


Best regards, 

Jessica Marques

Solution

Hi Jessica,

In the SQL query, you missed the SELECT statement after the WITH clause...


SQL Snippet

with yearlist as
(
    select 2010 as year
    union all
    select y1.year + 1 as year
    from yearlist y1
    where (y1.year + 1) <= YEAR(GetDate())
)
select year from yearlist order by year desc;


Hope this helps you!


Regards,

Benjith Sam

Solution

Benjith Sam wrote:

Hi Jessica,

In the SQL query, you missed the SELECT statement after the WITH clause...


SQL Snippet

with yearlist as
(
    select 2010 as year
    union all
    select y1.year + 1 as year
    from yearlist y1
    where (y1.year + 1) <= YEAR(GetDate())
)
select year from yearlist order by year desc;


Hope this helps you!


Regards,

Benjith Sam

Hello Benjith Sam,

 Thank you so much for your help, it worked perfectly.

 Regards, 

Jessica Alessandra de Jesus Marques wrote:

Hello Benjith Sam,

Thank you so much for your help, it worked perfectly.

 Regards, 

You're most welcome :)

Glad I could be of help!


Regards,

Benjith Sam