I am using Stata 17 on Windows. I am new to the ODBC process and I am trying to call in a large dataset from SQL. The dataset is mostly string variables, including the year variable. I have been successful with smaller datasets--they were able to load fairly quickly and I could manipulate the variables.
The code that works is:
Code:
odbc load, table("MySmallTable")
Code:
odbc load if year=="2015", table("MyTable) dsn("DataSource")
a) destring all the variables prior to loading to make the data more manageable
b) a way to destring just one variable (in this case year) so that I could try if year>2015
c) a way to indicate which specific values of year I want. for example if year=="2015" & "2016" & "2017"
Thank you so much in advance!
I am not able to share screenshots or the data due to the confidential nature of the data (accessed through a secure lab).
0 Response to Calling in SQL through ODBC--String variables & choosing data
Post a Comment