novinosrin, Thanks for the quick response. I tried your suggestion and got the following: 16 proc sql; 17 create table InstallDate as 18 SELECT 19 FLT.vehicle_header, 20 distinct FLT.vehicle_no, ___ 22 ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, FROM, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=. 21 FLT.occur_date, 22 FLT.FAULT_CODE, 23 FLT.FAULT_DESCRIPTION, 24 datepart(min(FLT.occur_date)) as sw_install_date format date9. 25 /*min(FLT.occur_date) as sw_install_date format dtdate9.*/ 26 FROM RMDEOAP.GETS_DW_EOA_FAULTS FLT 27 WHERE 28 FLT.vehicle_header = 'NS' and 29 datepart(FLT.occur_date) between '01Sep2016'd and datetime() 30 /*FLT.occur_date between '25Jul2017:00:00'dt and datetime()*/ 31 group by FLT.vehicle_no 32 ; NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. 33 quit;
... View more