Hello, I was writing DATE macro while connecting to SQL server using ODBC. I wrote the following code: data _null_;
START_DATE= intnx ('month',today(),-2,'B');
END_DATE= intnx ('month',today(),-1,'E');
call symput ('S_DATE', START_DATE);
Call Symput ('E_DATE', END_DATE);
run;
proc sql;
connect to odbc as ALIAS
(datasrc=SQLSERVER user=USER password=PWD);
create table DATASET as
select * from connection to ALIAS
(SELECT distinct *
FROM DATABASE.dbo.TABLE
WHERE DOS_FROM >= &S_DATE
)
;
QUIT; I got the following error: ERROR: CLI describe error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Operand type clash: date is incompatible with smallint : [Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared. Note: the variable DOS_FROM in the sql database is a format of date9.(DDMMMYYYY type). Any help is appreciated. Regards,
... View more