Date: Mon, 10 May 2004 08:54:00 -0400
Reply-To: "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Subject: Re: Insert into MS SQL 2000 by using SAS
On Mon, 10 May 2004 02:28:24 -0700, Loi Tan Vo <loi.tan.vo@FNH.NO> wrote:
>Hi all,
>
>I have a odbc connecting to MS SQL server 2000 and want by using SAS
>data step to insert data into a table in MS SQL. For ex.
>
>Proc sql;
>INSERT INTO sqllib.Table1(id, Name, Fromdate, tildate)
>VALUES(2,'statistic_1','01/01/2004'd,'31/01/2004'd);
>run;
>
>Then I got the followings errors
>ERROR: Invalid date/time/datetime constant '01/01/2004'd
>ERROR: Invalid date/time/datetime constant '31/01/2004'd
>
>How to convert datetime so that the ms sql can understand the
>datetime?
>
>Thanks in advance
>
Hi, Loi,
Try #01/01/2004# instead of '01/01/2004'd.
Cheers,
Chang
|