AnsweredAssumed Answered

Dashboard Query to Text Object returns "Invalid Query" although it works fine through SQL?

Question asked by syn_dean on Mar 15, 2013
Latest reply on Mar 15, 2013 by BryanMorrow

The issue is that i simply wanted to return a calendar date into my dashboard through a TEXT Object. i knew that there was no object to achieve this, so simply had to create a short SQL query to pull the data i wanted to show through the object from the DataBase. It is as follows:

 

Declare @dayName varchar(255);
Declare @day varchar(255);
Declare @Month varchar(255);
Declare @year varchar(255);

 

BEGIN
     Set @dayName = (SELECT DATENAME(dw,GETDATE()))
     Set @day = (SELECT DATENAME(day,GETDATE()))
     Set @Month = (SELECT DATENAME(month,GETDATE()))
     Set @year = (SELECT DATENAME(year,GETDATE()))

     Select @dayName + ', ' + @day + ' ' + @Month + ' ' + @year
END

 

When i run this through the "Data" options on the dahsboard designer, and then run TEST, i receive a message back saying "INVALID QUERY"

 

how can i resolve this?

Outcomes