I had a search on the site & couldn't find anything that explains why my Datasource Query is not returning a value.
What I'm basically doing is querying the SQL table to confirm if the current System date exists in the table. I've added the Variable "SysDailyDate" to the SQL per below:
Code: Select all
SELECT TM1_DAILY AS Period
FROM TRANSACTION_DETAIL
GROUP BY TM1_DAILY, TYPE
HAVING (TM1_DAILY = N'?SysDailyDate?') AND (TYPE = N'FMS')
Code: Select all
#========= P R O L O G =========
MyCube = 'z_ctrl_measures';
# define ODBC datasource for process from z_ctrl_measures
ODBCPath = CellGetS(MyCube,'ODBCPath Trans','String1');
DatasourceNameForServer=ODBCPath;
DatasourceNameForClient=ODBCPath;
# Define Variables
SysDailyDate = CellGetS(MyCube,'Current GL Daily Date','String 1') ;
ReportPath = CellGetS (MyCube , 'FilePath Trans Report', 'String 1');
# Open the ODBC Connection
ODBCOpen(ODBCPath ,'','') ;
Code: Select all
Asciioutput ( ReportPath | '\sql_DlyPeriods.txt', 'SQL Period: ' | Period | 'System Period: ' | SysDailyDate );
If i insert an actual date (i.e "14 Apr 2013") instead of the variable, it works perfectly...
I can only assume I've gotten the syntax wrong somewhere? Or am I going about this the wrong way?