From: William Shakespeare on
Whay am I getting this error message? Order_date is a daytime variable

56 proc sql;
57 create table sasdata.june_pre_period as
58 select a.oid_customer,
59 a.total_order_amount,
60 a.order_date,
61 a.store_id,
62 b.offerid,
63 b.campaignid
64 from mic_cdi.orders a
65 left join sasdata.client_july09 b
66 on a.oid_customer=b.oid_customer
67 where ((a.datepart(order_date)>='14JUN2009'd &
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *,
**, +, -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT,
NE, NET, OR, ^=, |, ||, ~=.

ERROR 76-322: Syntax error, statement will be ignored.

68 a.datepart(order_date)<='20JUN2009'd) or
69 (a.datepart(order_date)>='26JUL2009'd &
70 a.datepart(order_date)<='01AUG2009'd)) &
71 a.oid_customer in (select oid_customer
72 from sasdata.client_july09
73 where datepart(order_date)
>='26JUL2009'd &
74 datepart
(order_date),='01AUG2009'd
75 );
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of
statements.
76 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds