WRDS Web Query Form Conditional Statement Builder
The WRDS Web Query Form makes it easy to download data from a large range of datasets in a standardized manner. Many of the databases in WRDS include a Conditional Statement Builder as part of the Web Query Form.
Common ways to use the Conditional Statement Builder are to only download data for:
- equities traded on a specific exchange.
- companies headquartered in a specific country.
- specific class shares (like A-shares or REITs).
Use the Conditional Statement Builder to get daily price data for securities traded on the NYSE for December 2019.
Step 1: Navigate to the CRSP Daily Stock File
- Use the CRSP (in WRDS) link on the library's website and log in to WRDS (see WRDS Access).
- Under Subscriptions go to CRSP > Stock/Security Files > Daily Stock File.
Step 2: Fill out the Web Query Form
- Step 1: Enter the date range (December 1, 2019 to December 31, 2019).
- Step 2: Select Search the Entire Database.
- Step 3: Select the desired variables. In this example select: Company Name, Ticker, CUSIP, NCUSIP, CRSP Permanent Company Number (as it is always good to have all the identifiers) and Price.
- In order to use a variable in the Conditional Statement Builder (such as the exchange), you must select it as a query variable. Before adding it to your selected variables, use the (?) icon to note the code you will need in the Conditional Statement Builder. In this example, you need to know that 1 is the Exchange Code for the NYSE.
- In the Conditional Statements drop-down menu select the variable you want to use (in this case, Exchange Code). Change the second drop-down if needed (such as to exclude a share code) and in the third field enter the exchange code for the NYSE, which is 1.
- Step 4: Select the output (e.g. csv).
- Press Submit Query. When the download is complete, click the link to view.