I'm not 100% sure here, but I never use SAS SQL code on other SQL platforms. To be more precise, in SAS SQL you can create tables "on the fly" by using the "create table foo as ..." syntax but I think this is only a convenient SAS structure which will not translate over to other SQL platforms like microsoft visual studio (although it may for some, I don't know). Although I thought this was a SAS forum, I will propose the following solution because the syntax below is also allowed in SAS SQL although sometimes unnecessary: FIrst create a blank shell for your table using: create table B ( date as date, xx as float, yy as float ) ; Notice that there is no "as" after the create statement! Then insert into that table the values you want: insert into B select date, sum(x) as xx,sum(y) as yy from table A group by date ; You should note that some things may change depending on the syntax of SQL in microsoft visual studio... For instance the the round parenthases, (), may be curly brackets, {}.And the declaration of "date as date" may require a different data type. I haven't used SQL in visual studio so I can't give you any exact code, but I think this will get you on your way... Message was edited by: never aragafi
Notice that there is no "as" after the create statement!
... View more