/
Extracting data using the Microsoft Query wizard

Extracting data using the Microsoft Query wizard

The following example shows how to extract student names and contact details from the Synergetic database using the Microsoft Query wizard.

  1. Start Microsoft Excel.
  2. Select:

    • Data > From Other Sources > From Microsoft Query (Microsoft Excel 2010 and Microsoft Excel 2013)

    • Data > Import External Data > New Database Query (Microsoft Excel 2007)
    • Data > Import External Data > New Database Query (Microsoft Excel 2003)
    • Data > Get External Data > Create New Query (Microsoft Excel 97).

    The Choose Data Source window is displayed.
  3. Select the Synergetic database.

    Note: Entries prefixed with 'SynergyOne' are pre-Version 68 entries.

  4. Select the Use the Query Wizard to create/edit queries field, if not already selected.
  5. Click .
    The Options are is displayed.
  6. Check the database displayed in the database field to ensure you are not accidentally connecting to a pre-68 or synonym database.
  7. Click .
    The SQL Server Login window is displayed.
  8. Type in your username and password.

    Note:
    This is your usual Synergetic username and password.

  9. Click .
    The Query Wizard - Choose Columns window is displayed.
  10. Scroll down the list of tables until you get to the views. These all start with a small v.


    Note:
    Only the tables and columns you have permission to access are displayed. If you need more views, contact your system administrator.

    Tip:
    You can limit the number of Available tables and columns displayed by clicking then selecting dbo from the Owner drop-down list to show just the standard Synergetic objects.

  11. Click the  to the left of the selected view to list all fields that this view is contains. For example, vStudentContactAddress.
  12. To select fields, highlight them then click .

    Note:
    If you click this button while the view name is selected then all fields in this view will be added to the columns in your query. However, you rarely need to use all of the fields in a view or base table.

  13. To follow this example, select the fields as shown in the screen capture below.

    Note:
    Scroll down in the Available tables and columns area to find each of the fields.

    Note: See the Useful fields section below.


  14. Repeat steps 10 and 11 until no more fields (columns) are required.
  15. Click .
    The Query Wizard - Filter Data window is displayed.


    Tip:
    You can also come back to this screen at any time by clicking  while you are still using the wizard.

  16. Select the field (column) to filter on and the selection criteria. For example, you can enter the following selection criteria, CurrentSemesterOnlyFlag equals 1, to retrieve records for the current year and semester. In the following example, the first selection criteria set is FileYear equals 2016.


    Tip:
    If the view contains the CurrentSemesterOnly flag, you can use this instead of FileYear and FileSemester fields to select the File Year and Semester defaults you have defined in your preferences.

    Note: When you choose your filter the Column Name becomes bold, this will let you know what fields you have already applied filters to.

  17. Click .
    The Query Wizard - Sort Order window is displayed.
  18. Select the field to base the sorting data on. You can choose multiple fields to sort by but Surname is usually a good option.
    For example, click the drop-down list and select Surname. Leave the sort type as Ascending.

    Note:
    Ascending order is A-Z, descending order is Z-A.
     

  19. Click .
    The Query Wizard - Finish window is displayed.
  20. Either:
    • Click
    or
    • Click , if you plan to reuse this query at a later date.
    The Save As window is displayed.
  21. Name the query using a suitable name, such as vStudentContactAddress
  22. Click .
    The Query Wizard - Finish window is redisplayed.
  23. Select Return Data to Microsoft Office Excel.
  24. Click .
  25. Switch back to Microsoft Excel.
    The Import Data window is displayed.
  26. Select the starting position on the spreadsheet.
  27. Click