29.10.2014 Views

Extracting data from the Synergetic database

Extracting data from the Synergetic database

Extracting data from the Synergetic database

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

O M P U T I N G<br />

D I R E C T I O N S<br />

A U S T R A L I A<br />

<strong>Synergetic</strong> User Manual<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong><br />

<strong>Synergetic</strong> <strong>data</strong>base<br />

Version 60<br />

Copyright © 2009 Computing Directions Australia Pty Ltd<br />

This work is copyright and may not be reproduced except<br />

in accordance with <strong>the</strong> provisions of <strong>the</strong> Copyright Act<br />

Published: 24 March 2009


This page intentionally left blank


Contents<br />

Contents<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base ..................................................................................... 6-1<br />

What's new to <strong>Extracting</strong> <strong>data</strong> .......................................................................................................... 6-2<br />

<strong>Synergetic</strong> views ............................................................................................................................... 6-5<br />

Main <strong>Synergetic</strong> views................................................................................................................... 6-7<br />

Main Finance views..................................................................................................................... 6-19<br />

<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard .......................................................................... 6-25<br />

Editing a Microsoft Query using <strong>the</strong> wizard .................................................................................... 6-35<br />

Common duplication problems ....................................................................................................... 6-38<br />

Inserting an existing SQL statement............................................................................................... 6-40<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly ............................................................................... 6-46<br />

<strong>Extracting</strong> student name and contact details example................................................................ 6-51<br />

Advanced Microsoft Query and SQL examples.............................................................................. 6-63<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong> ......................................................................... 6-71<br />

Stored procedures....................................................................................................................... 6-72<br />

Creating mail merge letters using stored procedures ................................................................. 6-73<br />

Printing mail merge letters using an existing document.............................................................. 6-82<br />

Reprinting mail merge letters ...................................................................................................... 6-86<br />

Index................................................................................................................................................... 6-89<br />

Version 60 Page 6-i


This page intentionally left blank


What's new to <strong>Extracting</strong> <strong>data</strong><br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

You can extract <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base for your own purposes, using tools such as:<br />

• Microsoft Excel<br />

• Microsoft Word.<br />

Views have been developed to make it easier to extract <strong>data</strong>. See <strong>Synergetic</strong> views (on page 5).<br />

Stored procedures have also been developed, particularly for extracting <strong>data</strong> for mail merge letters.<br />

See Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong> (on page 71).<br />

How to<br />

• Extract <strong>data</strong> using <strong>the</strong> Microsoft Query wizard. See <strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query<br />

wizard (on page 25).<br />

Note: We do not recommend using <strong>the</strong> wizard as subsequent changes are more complex to<br />

implement. The wizard is used mainly for creating quick queries but does not introduce you to <strong>the</strong><br />

full functionality of Microsoft Query.<br />

• Edit a query using <strong>the</strong> Microsoft Query wizard. See Editing a Microsoft Query using <strong>the</strong> wizard<br />

(on page 35).<br />

• Open a query that has already been perfected. Inserting an existing SQL statement (on<br />

page 40).<br />

• Edit a query using Microsoft Query directly. See <strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

(on page 46).<br />

• Create a query using Microsoft Query directly. See <strong>Extracting</strong> student name and contact<br />

details example (on page 51).<br />

• Create advanced queries using Microsoft Query directly. See Advanced Microsoft Query and<br />

SQL examples (on page 63).<br />

Version 60 Page 6-1


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

What's new to <strong>Extracting</strong> <strong>data</strong><br />

What's new to <strong>Extracting</strong> <strong>data</strong><br />

Version 60<br />

This section outlines <strong>the</strong> changes to <strong>the</strong> <strong>Extracting</strong> <strong>data</strong> manual arising <strong>from</strong> changes made to<br />

<strong>Synergetic</strong> (version 59.15-v60.37).<br />

Change More information See<br />

Views<br />

available for<br />

use.<br />

The introduction has been updated and two new topics<br />

have been added, listing <strong>the</strong> main views available:<br />

• Main <strong>Synergetic</strong> views<br />

• Main Finance views.<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong><br />

<strong>Synergetic</strong> <strong>data</strong>base (on<br />

page 1)<br />

<strong>Synergetic</strong> views (on<br />

page 5)<br />

Main <strong>Synergetic</strong> views (on<br />

page 7)<br />

Main Finance views (on<br />

page 19)<br />

Page 6-2 Version 60


What's new to <strong>Extracting</strong> <strong>data</strong><br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Change More information See<br />

New views<br />

added.<br />

Descriptions have been included for <strong>the</strong> following views,<br />

which were added recently:<br />

• vxeOliverBorrowingExport<br />

• vStudentRelationsAll<br />

• vNZMOE_StudentDataChanges<br />

• vStudentContactsLivesWith<br />

• vNZMOE_eAR_SchoolDetails<br />

• vStudentParentsMCEETYA<br />

• vStudentAbsenceEvents<br />

• vStudentAbsenceEventsAttendances<br />

• vStudentMedicalDetails<br />

Fields in <strong>the</strong> following views have been changed or<br />

added but no specific information has been included in<br />

<strong>the</strong> documentation:<br />

• vCommunityAddresses<br />

• vCommunityAddressesConstit<br />

• vDebtorFees<br />

• vStudentMedDetailsPrimContact<br />

• vStudentsCurrentPastFutureCombined<br />

• vStudentContactAddress<br />

• Absences<br />

• vStudentReportsSemesterResults<br />

• vStaffTimetableFull<br />

• vStudentClassesAll<br />

• pvStudentAssessmentMarkbookAreas<br />

• vTimetableRooms<br />

• vCreditorTransactions<br />

• pvPayrollEmployeeLeaveEntitleAll<br />

• vPayrollEmployeeLeaveSummary<br />

Main <strong>Synergetic</strong> views (on<br />

page 7)<br />

Version 60 Page 6-3


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

What's new to <strong>Extracting</strong> <strong>data</strong><br />

Change More information See<br />

Updated<br />

topics.<br />

Additional screen captures have been included to:<br />

• improve <strong>the</strong> readability of <strong>the</strong> examples<br />

• provide updated information for a later release<br />

of Microsoft Excel (2003).<br />

<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong><br />

Microsoft Query wizard (on<br />

page 25)<br />

<strong>Extracting</strong> student name<br />

and contact details example<br />

(on page 51)<br />

Editing a Microsoft Query<br />

using <strong>the</strong> wizard (on<br />

page 35)<br />

<strong>Extracting</strong> student name<br />

and contact details example<br />

(on page 51)<br />

New topics.<br />

New topics have been included to provide information<br />

on using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong>.<br />

Examples are provided for developing mail merge<br />

letters.<br />

Using stored procedures to<br />

retrieve <strong>Synergetic</strong> <strong>data</strong> (on<br />

page 71)<br />

Creating mail merge letters<br />

using stored procedures<br />

(on page 73)<br />

Printing mail merge letters<br />

using an existing document<br />

(on page 82)<br />

Reprinting mail merge<br />

letters (on page 86)<br />

Page 6-4 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

The Computing Directions Australia (CDA) development team have developed views <strong>from</strong> <strong>the</strong><br />

<strong>Synergetic</strong> <strong>data</strong>base tables to make querying <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base an easier process.<br />

The views contain links between several base tables, that include related information that can be used<br />

in similar queries. The information can be <strong>from</strong> single fields or generated fields.<br />

Links (or joins) can be made between several views and base tables but sometimes <strong>the</strong> linking<br />

process can be difficult. Contact CDA if you want to include a field in an existing view or you require<br />

assistance with joining tables.<br />

Details on <strong>the</strong> views are provided in two sections, based on where <strong>the</strong> primary <strong>data</strong> is sourced:<br />

• Main <strong>Synergetic</strong> <strong>data</strong>base. See Main <strong>Synergetic</strong> views (on page 7).<br />

• Finance <strong>data</strong>base. See Main Finance views (on page 19).<br />

Note: New views are created and released during each <strong>Synergetic</strong> update. See What's new to<br />

<strong>Extracting</strong> <strong>data</strong> (on page 2).<br />

Tip: Views are listed in alphabetic order in each topic. If you are using <strong>Synergetic</strong> Online Help<br />

you can also find a view by typing its name on <strong>the</strong> Search tab. In <strong>the</strong> example below,<br />

vCommunityAddresses is found in two topics.<br />

Fields<br />

Fields contain all of <strong>the</strong> information that is maintained in <strong>Synergetic</strong>. You can use any field you want in<br />

your query but it is recommended that you select <strong>the</strong> fields <strong>from</strong> a view.<br />

The following table lists fields useful for filtering <strong>data</strong>:<br />

Field<br />

Value<br />

DeceasedFlag 0<br />

ValidAddressFlag 1<br />

CurrentSemesterOnlyFlag 1<br />

Version 60 Page 6-5


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

Field<br />

Value<br />

FileYear 2009<br />

FileSemester<br />

StudentStatus<br />

1, 2, ...n<br />

LFT<br />

Note: 4 is left, 1 is normal.<br />

StudentContactType<br />

SC1, SC2 or SCT<br />

StudentContactNormalMailFlag 1<br />

Generated fields<br />

Generated fields can be one or more fields that have been combined and manipulated toge<strong>the</strong>r to<br />

create ano<strong>the</strong>r new field.<br />

The following table provides details about useful generated fields:<br />

Generated<br />

field<br />

MailSalutation<br />

Description<br />

Combines <strong>the</strong> title of a person<br />

with <strong>the</strong>ir surname.<br />

If this person has a spouse and<br />

<strong>the</strong> Address to primary only<br />

field on <strong>the</strong> Contact tab of<br />

Student Maintenance is not<br />

selected, <strong>the</strong>ir title will be<br />

joined with <strong>the</strong> partner’s.<br />

Example<br />

Mr Johnson<br />

Mr and Mrs Johnson<br />

MailName<br />

Combines <strong>the</strong> title, first name<br />

and surname.<br />

AddressComma A comma-delimited address<br />

useful for:<br />

Mr P Johnson<br />

4/303 Burwood Hwy, Burwood East, Vic, 3151<br />

AddressFull<br />

• printouts<br />

• using in Microsoft<br />

Excel.<br />

A carriage return/line feeddelimited<br />

address useful for:<br />

• mail merges<br />

• labels.<br />

4/303 Burwood Hwy<br />

Burwood East Vic 3151<br />

Page 6-6 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Main <strong>Synergetic</strong> views<br />

Views have been created by <strong>the</strong> CDA development team to make querying <strong>the</strong> <strong>data</strong>base an easier<br />

process. These views are ei<strong>the</strong>r <strong>from</strong> <strong>the</strong>:<br />

• Main <strong>Synergetic</strong> <strong>data</strong>base, as outlined below.<br />

• Finance <strong>data</strong>base. See Main Finance views (on page 19).<br />

View name Description Base tables used<br />

vCommunity-<br />

Addresses<br />

vCommunity-<br />

AddressesConstit<br />

vCommunications-<br />

Current<br />

vCommunications-<br />

Past<br />

vDonorPledges<br />

Use this view to query on community<br />

members.<br />

This view includes all fields <strong>from</strong> <strong>the</strong><br />

Community and Addresses tables. It has<br />

spouse and occupation details as well.<br />

Use this view to query on community<br />

members and <strong>the</strong>ir constituencies.<br />

This view includes all fields <strong>from</strong> <strong>the</strong><br />

Community, Addresses and Constituency<br />

tables. Spouse and occupation details can<br />

be extracted as well. A community record will<br />

be duplicated for every constituency that <strong>the</strong>y<br />

have. You would normally do a record<br />

selection on ConstitCode to only get one<br />

record per person.<br />

Use this view to list current communications,<br />

with <strong>the</strong> name and address details of <strong>the</strong><br />

recipients.<br />

Automatically excludes deceased people.<br />

Use this view to list past communications,<br />

with <strong>the</strong> name and address details of <strong>the</strong><br />

recipients.<br />

Automatically excludes deceased people.<br />

Use this view to list donor pledges and <strong>the</strong><br />

amount received against each pledge, with:<br />

• name and address details of <strong>the</strong><br />

donor<br />

• appeal and fund details.<br />

• Community<br />

• Addresses<br />

• luOccupation<br />

• Community<br />

• Constituencies<br />

• Addresses<br />

• luConstituency<br />

• luOccupation<br />

• CommunityCommuni<br />

cationsCurrent<br />

• Communications<br />

• Community<br />

• Addresses<br />

• CommunityCommuni<br />

cations<br />

• Communications<br />

• Community<br />

• Addresses<br />

• DonorPledges<br />

• Community<br />

• Addresses<br />

• luAppeal<br />

• luFund<br />

Version 60 Page 6-7


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

View name Description Base tables used<br />

vDonorPledges-<br />

Receipts<br />

vDonorProspect-<br />

Address<br />

vDonorProspect-<br />

HistoryAddress<br />

vDonorReceipts<br />

vEnquiryContact-<br />

Address<br />

Use this view to list donor pledges and<br />

detailed receipt information for each pledge<br />

with:<br />

• name and address details of <strong>the</strong><br />

donor<br />

• appeal and fund details.<br />

Use this view for donor prospect name and<br />

address details, as well as:<br />

• fund and appeal information that<br />

<strong>the</strong>y are prospected for<br />

• staff and volunteer name<br />

information, which comes <strong>from</strong> extra<br />

joins to <strong>the</strong> Community table.<br />

Automatically excludes deceased prospects.<br />

Use this view for donor prospect history<br />

(activities) with:<br />

• prospect name and address details<br />

• appeal information that <strong>the</strong>y are<br />

prospected for.<br />

Automatically excludes deceased prospects.<br />

Use this view for detailed receipt information<br />

with:<br />

• name and address details of <strong>the</strong><br />

donor<br />

• appeal and fund information.<br />

Use this view to list:<br />

• enquiry contacts<br />

• <strong>the</strong>ir name and address details<br />

• <strong>the</strong> students that <strong>the</strong>y are associated<br />

with.<br />

If <strong>the</strong> person is a member of <strong>the</strong> community,<br />

<strong>the</strong> information comes <strong>from</strong> <strong>the</strong> actual<br />

Community table, o<strong>the</strong>rwise it comes off <strong>the</strong><br />

enquiry tables.<br />

Automatically excludes deceased people.<br />

• DonorPledges<br />

• Community<br />

• Addresses<br />

• DonorReceipts<br />

• luAppeal<br />

• luFund<br />

• DonorProspects<br />

• Community<br />

• Addresses<br />

• luAppeal<br />

• DonorProspects<br />

• Community<br />

• Addresses<br />

• luAppeal<br />

• DonorProspectHistor<br />

y<br />

• DonorReceipts<br />

• Community<br />

• Addresses<br />

• luAppeal<br />

• luFund<br />

• EnquiryStudentConta<br />

cts<br />

• EnquiryStudents<br />

• Community<br />

• Addresses<br />

Page 6-8 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

View name Description Base tables used<br />

vEvents<br />

vEventsCurrent<br />

vEventsPast<br />

vFutureContact-<br />

Address<br />

vFutureStudents<br />

vNZMoE_eAR_-<br />

SchoolDetails<br />

Use this view for information on events and<br />

<strong>the</strong>ir locations, without any attendee details.<br />

Use this view for information on current<br />

events and <strong>the</strong>ir locations, with attendee<br />

name and address details.<br />

Automatically excludes deceased attendees.<br />

Use this view for information on past events<br />

and <strong>the</strong>ir locations, with attendee name and<br />

address details.<br />

Use this view for future student names and<br />

entry information, along with:<br />

• contact name and address details for<br />

each of <strong>the</strong> student's contacts<br />

• spouse information for each contact.<br />

Automatically excludes deceased future<br />

students and contacts.<br />

Use this view for future student names and<br />

entry information, if you do not want any<br />

contact or relationship information.<br />

Automatically excludes cancelled or<br />

deceased future students.<br />

Use this view for <strong>the</strong> school number and<br />

name based on campus, using <strong>the</strong><br />

configuration for <strong>the</strong> New Zealand Ministry of<br />

Education (NZMoE) electronic attendance<br />

register (eAR).<br />

If <strong>the</strong> configuration details are not available,<br />

<strong>the</strong> following details are retrieved:<br />

• The school name <strong>from</strong> <strong>the</strong><br />

configuration file maintenance using<br />

<strong>the</strong> System | Install | Name key.<br />

• The school number <strong>from</strong> <strong>the</strong> School<br />

table.<br />

• Events<br />

• luLocation<br />

• CommunityEventsCu<br />

rrent<br />

• Community<br />

• Events<br />

• luLocation<br />

• Addresses<br />

• CommunityEvents<br />

• Community<br />

• Events<br />

• luLocation<br />

• Addresses<br />

• FutureStudents<br />

• Community<br />

• FutureStudentContac<br />

ts<br />

• Addresses<br />

• luContact<br />

• luFutureStatus<br />

• FutureStudents<br />

• Community<br />

• luFutureStatus<br />

• luHouse<br />

• luCampus<br />

• School<br />

Version 60 Page 6-9


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

View name Description Base tables used<br />

vNZMoE_Student-<br />

DataChanges<br />

vPastStudent-<br />

Address<br />

vStaff<br />

vStaffTimetableFull<br />

vStudentAbsences<br />

Use this view for <strong>data</strong> changes by student<br />

and year level.<br />

This is required for New Zealand Ministry of<br />

Education (NZMoE) electronic attendance<br />

register (eAR) audit requirements.<br />

Use this view for past student names and<br />

<strong>the</strong>ir:<br />

• address<br />

• schooling information<br />

• occupation information.<br />

Use this view for personal staff details. This<br />

view contains detailed name and address<br />

information.<br />

Automatically excludes deceased staff<br />

members.<br />

Use this view for staff timetable details. This<br />

view does not contain detailed name and<br />

address information.<br />

Automatically excludes deceased staff<br />

members.<br />

Use this view for absentee information with<br />

student name details.<br />

Note: This view has been superseded by<br />

vStudentAbsenceEvents.<br />

• SystemDataChanges<br />

• Community<br />

• FileSemesters<br />

• StudentYears<br />

• PastStudents<br />

• Community<br />

• Addresses<br />

• luCampus<br />

• luBranch<br />

• luOccupation<br />

• luBoarder<br />

• luHouse<br />

• Staff<br />

• Community<br />

• luCampus<br />

• Addresses<br />

• Staff<br />

• Community<br />

• luCampus<br />

• luYearLevel<br />

• luTimetableGroup<br />

• TimetableDefinition<br />

• Timetable<br />

• SubjectClasses<br />

• Absences<br />

• StudentSemester<br />

• Community<br />

• luAbsenceType<br />

Page 6-10 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

View name Description Base tables used<br />

vStudentAbsence-<br />

Events<br />

vStudentAbsence-<br />

EventsAttendances<br />

vStudentAssessment<br />

AreaSendMat<br />

vStudentAssessment<br />

AreasResults<br />

Use this view for all absence events that<br />

have not been superseded.<br />

Includes student details.<br />

Use this view for attendance information.<br />

Includes attendances and nonattendances.<br />

This view is based on<br />

vStudentAbsenceEvents.<br />

Use this view for lesson and materials to be<br />

sent to correspondence students, along with<br />

<strong>the</strong>ir name and address details.<br />

Only includes lessons that have been<br />

flagged as picked.<br />

Automatically excludes deceased students.<br />

Use this view for result information <strong>from</strong><br />

lessons processed for correspondence<br />

students. Also includes:<br />

• name and address details<br />

• schooling information.<br />

Used by <strong>the</strong> Correspondence system only.<br />

• AbsenceEvents<br />

• Community<br />

• StudentYears<br />

• Students<br />

• vStudentAbsenceEve<br />

nts<br />

• tAttendances<br />

• AttendanceMaster<br />

• SubjectClasses<br />

• SubjectClassStaff<br />

• pvTimetableDefinitio<br />

n<br />

• StudentAssessmentA<br />

reas<br />

• Community<br />

• SubjectClasses<br />

• Addresses<br />

• SubjectAssessmentA<br />

reas<br />

• SubjectAssessment<br />

Materials<br />

• Materials<br />

• Students<br />

• Community<br />

• StudentSemester<br />

• Addresses<br />

• StudentClasses<br />

• SubjectClasses<br />

• SubjectAssessmentA<br />

reas<br />

• StudentAssessment<br />

Results<br />

Version 60 Page 6-11


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

View name Description Base tables used<br />

vStudentClasses<br />

vStudentContact-<br />

Address<br />

vStudentContact-<br />

AllAddress<br />

Use this view to list students and <strong>the</strong> classes<br />

<strong>the</strong>y are taking. Also includes:<br />

• relevant information about <strong>the</strong> staff<br />

member who teaches <strong>the</strong> classes<br />

• information about house captains<br />

and Head of Campus.<br />

Automatically excludes students who:<br />

• have left<br />

• are on leave of absence<br />

• are deceased.<br />

Use this view for student names and<br />

schooling information, along with:<br />

• contact name and address details for<br />

primary and alternate contacts<br />

• spouse information for each contact.<br />

Automatically excludes:<br />

• term contacts<br />

• deceased students<br />

• deceased contacts.<br />

Use this view for student names and<br />

schooling information, along with contact<br />

name and address details for all contacts,<br />

including term contacts.<br />

Automatically excludes deceased:<br />

• students<br />

• contacts.<br />

• Students<br />

• StudentSemester<br />

• StudentClasses<br />

• SubjectClasses<br />

• Community<br />

• SubjectClassStaff<br />

• Staff<br />

• luHouse<br />

• luCampus<br />

• luStudentStatus<br />

• luYearLevel<br />

• Students<br />

• Community<br />

• StudentSemester<br />

• StudentContacts<br />

• Addresses<br />

• luContact<br />

• luStudentStatus<br />

• luCampus<br />

• luForm<br />

• Students<br />

• Community<br />

• StudentSemester<br />

• StudentContacts<br />

• Addresses<br />

• luContact<br />

• luStudentStatus<br />

• luCampus<br />

• luForm<br />

Page 6-12 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

View name Description Base tables used<br />

vStudentContacts-<br />

ParentsDebtor<br />

vStudentContacts-<br />

RelationOnly<br />

vStudentCourses<br />

vStudentForms-<br />

Absences<br />

Use this view to obtain student names and<br />

schooling details, along with name and<br />

address details for <strong>the</strong> student's:<br />

• debtor<br />

• mo<strong>the</strong>r<br />

• fa<strong>the</strong>r.<br />

Excludes students who:<br />

• have left your organisation<br />

• are deceased.<br />

Use this view to obtain:<br />

• student names<br />

• address and occupation information<br />

for each relation<br />

• <strong>the</strong>ir relationship with <strong>the</strong> student.<br />

Automatically excludes term contacts.<br />

Use this view to obtain information on<br />

courses that a student is doing. Includes<br />

basic name information.<br />

Use this view to obtain a list of absent<br />

students by form.<br />

• Students<br />

• Community<br />

• StudentSemester<br />

• StudentContacts<br />

• Addresses<br />

• Relationships<br />

• luContact<br />

• luStudentStatus<br />

• luCampus<br />

• luForm<br />

• Students<br />

• StudentContacts<br />

• Community<br />

• Addresses<br />

• luOccupation<br />

• Relationships<br />

• luContact<br />

• luRelationship<br />

• Students<br />

• StudentCourses<br />

• Courses<br />

• Community<br />

• luForm<br />

• StudentSemester<br />

• Absences<br />

• Community<br />

• luAbsenceType<br />

Version 60 Page 6-13


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

View name Description Base tables used<br />

vStudentMedDetails-<br />

PrimContact<br />

vStudentMedical-<br />

Details<br />

Use this view to obtain student medical<br />

information as well as:<br />

• primary contact information for<br />

emergency contacts<br />

• <strong>the</strong>ir relationship to <strong>the</strong> student.<br />

Retrieves information as detailed in <strong>the</strong><br />

vStudentContactAddress view, covered<br />

earlier.<br />

Use this view to obtain:<br />

• all student medical information<br />

• information <strong>from</strong> current students<br />

and community functions.<br />

One record is output per student.<br />

Does not include medical incidents.<br />

• vStudentContactAddr<br />

ess<br />

• Students<br />

• StudentMedicalDetail<br />

s<br />

• Community<br />

• Addresses<br />

• luRelationship<br />

• luMedicalPrivateInsur<br />

anceFund<br />

• luAsthmaCategory<br />

• StudentYears<br />

• Students<br />

• StudentStatic<br />

• StudentMedicalDetail<br />

s<br />

• Community<br />

vStudentParents-<br />

MCEETYA<br />

vStudentRelations<br />

Use this view to extract MCEETYA<br />

(Australian Ministerial Council of Education,<br />

Training and Youth Affairs) parent details,<br />

including:<br />

• Occupation Group<br />

• Home Language<br />

• Highest Qualification Level<br />

• Highest Secondary Level.<br />

Use this view to show students and all of<br />

<strong>the</strong>ir relations.<br />

Excludes students who are deceased.<br />

Also, see vStudentRelationsAll.<br />

vStudentRelationsAll Use this view to show students and all of<br />

<strong>the</strong>ir relations.<br />

Includes all records, including deceased<br />

students.<br />

Also see vStudentRelations.<br />

• pvStudentParents<br />

• vCommunityAddress<br />

es<br />

• Students<br />

• StudentSemester<br />

• Relationships<br />

• pvCommunity<br />

• Addresses<br />

• Students<br />

• StudentSemester<br />

• Relationships<br />

• pvCommunity<br />

• Addresses<br />

Page 6-14 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

View name Description Base tables used<br />

vStudentReports-<br />

NoResults<br />

vStudentReports-<br />

Semester<br />

vStudentReports-<br />

SemesterYear<br />

Use this view to show which:<br />

• students have not had results<br />

entered for <strong>the</strong>m<br />

• which staff members are responsible<br />

for entering <strong>the</strong> results.<br />

Use this view to obtain <strong>the</strong> overall results of<br />

students, comments and staff information.<br />

This view does not contain detailed results.<br />

To get detailed results, refer to<br />

vStudentReportsSemesterResults,<br />

covered below.<br />

This view contains identical information to<br />

that of vStudentReportsSemester but is<br />

required to get <strong>the</strong><br />

StudentClassOverallMarkForYear results<br />

for <strong>the</strong> year.<br />

The field is included in this view to avoid any<br />

discrepancies arising <strong>from</strong> semester<br />

selections.<br />

• StudentClasses<br />

• StudentSemester<br />

• Community<br />

• SubjectClasses<br />

• SubjectClassStaff<br />

• Staff<br />

• SubjectAssessments<br />

• StudentAssessment<br />

Comments<br />

• SubjectAssessmentA<br />

reas<br />

• StudentAssessment<br />

Results<br />

• StudentSemester<br />

• Students<br />

• Community<br />

• luHouse<br />

• StudentClasses<br />

• SubjectClasses<br />

• SubjectClassStaff<br />

• Staff<br />

• SubjectAssessments<br />

• StudentAssessment<br />

Comments<br />

• vStudentReportsSem<br />

ester<br />

Version 60 Page 6-15


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

View name Description Base tables used<br />

vStudentReports-<br />

SemesterResults<br />

vStudents<br />

vStudentsAll<br />

Use this view to obtain detailed student<br />

results.<br />

It does not include overall results or<br />

comments. To get overall results and<br />

comments, refer to <strong>the</strong><br />

vStudentReportsSemester view, covered<br />

earlier.<br />

Use this view for student schooling and<br />

name details. The view does not include:<br />

• contact details<br />

• relationship information.<br />

Automatically excludes students who:<br />

• have left your organisation<br />

• are on leave of absence<br />

• are deceased.<br />

The view was designed for fast, simple<br />

queries. Also, see:<br />

• vStudentsAll<br />

• vStudentAndLOA, covered below.<br />

Use this view for student schooling and<br />

name details. This view:<br />

• does not include contact or<br />

relationship information<br />

• includes a lot more information than<br />

<strong>the</strong> vStudents view, covered earlier<br />

• includes all students, regardless of<br />

<strong>the</strong>ir status.<br />

This view was created for more detailed<br />

queries but runs slower than <strong>the</strong> vStudents<br />

view.<br />

• StudentClasses<br />

• SubjectClasses<br />

• SubjectAssessmentA<br />

reas<br />

• StudentAssessment<br />

Results<br />

• Students<br />

• StudentSemester<br />

• Community<br />

• luStudentStatus<br />

• luCampus<br />

• luHouse<br />

• luYearLevel<br />

• luForm<br />

• luTutor<br />

• Students<br />

• StudentSemester<br />

• Community<br />

• luStudentStatus<br />

• luCampus<br />

• luHouse<br />

• luYearLevel<br />

• luForm<br />

• luTutor<br />

• luParish<br />

• luReligion<br />

• luPreviousSchool<br />

Page 6-16 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

View name Description Base tables used<br />

vStudentsAndLOA<br />

vStudentsContacts-<br />

LivesWith<br />

vStudentSubject-<br />

Class<br />

Use this view for student schooling and<br />

name details. This view:<br />

• does not include contact or<br />

relationship information<br />

• includes a lot more information than<br />

<strong>the</strong> vStudents view, covered earlier<br />

• includes all current students and<br />

those on leave of absence but<br />

excludes students who have left<br />

your organisation.<br />

This view was created for more detailed<br />

queries but runs slower than <strong>the</strong> vStudents<br />

view.<br />

Also, see <strong>the</strong> vStudentAll view, covered<br />

earlier.<br />

Use this view to get <strong>the</strong> <strong>Synergetic</strong> IDs of<br />

contact 1 and contact 2 for each student,<br />

based on <strong>the</strong> highest ranked contact with <strong>the</strong><br />

Lives With flag selected.<br />

If only one contact has <strong>the</strong> Lives With flag<br />

selected <strong>the</strong>n <strong>the</strong> view will use this person as<br />

contact 1 and <strong>the</strong>ir spouse as contact 2.<br />

If two contacts have <strong>the</strong> Lives With flag<br />

selected <strong>the</strong>n <strong>the</strong> view will use <strong>the</strong> primary<br />

person in <strong>the</strong> relationship as contact 1 and<br />

<strong>the</strong> o<strong>the</strong>r person in <strong>the</strong> relationship as<br />

contact 2.<br />

Includes:<br />

• students<br />

• future students<br />

• past students.<br />

Use this view to obtain a list of classes that a<br />

student is doing, along with <strong>the</strong> staff member<br />

who is teaching that class.<br />

Automatically excludes deceased students.<br />

• Students<br />

• StudentSemester<br />

• Community<br />

• luStudentStatus<br />

• luCampus<br />

• luHouse<br />

• luYearLevel<br />

• luForm<br />

• luTutor<br />

• Community<br />

• Students<br />

• StudentContacts<br />

• FutureStudents<br />

• FutureStudentsConta<br />

cts<br />

• PastStudents<br />

• PastStudentsContact<br />

s<br />

• Students<br />

• StudentSemester<br />

• StudentClasses<br />

• Community<br />

• SubjectClasses<br />

• SubjectClassStaff<br />

Version 60 Page 6-17


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

View name Description Base tables used<br />

vStudentTimetable-<br />

Full<br />

vStudentTutors-<br />

Absences<br />

vxeOliverBorrowing-<br />

Export<br />

Use this view to obtain timetable details for<br />

students, including:<br />

• rooms<br />

• days<br />

• periods<br />

• <strong>the</strong> staff members teaching <strong>the</strong><br />

classes.<br />

Use this view to obtain a list of student<br />

absences by tutor.<br />

Use this view to obtain a list of current<br />

students and active staff, along with <strong>the</strong>ir<br />

contact details.<br />

• StudentSemester<br />

• Students<br />

• Community<br />

• luYearLevel<br />

• luTimetableGroup<br />

• luHouse<br />

• luCampus<br />

• luForm<br />

• StudentClasses<br />

• Timetable<br />

• Staff<br />

• TimetableDefinition<br />

• luTutor<br />

• StudentSemester<br />

• Absences<br />

• Community<br />

• luAbsenceType<br />

• Community<br />

• StudentContacts<br />

• Students<br />

• StudentYears<br />

• StudentSemester<br />

• Community<br />

• Addresses<br />

Page 6-18 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Main Finance views<br />

Views have been created by <strong>the</strong> CDA development team to make querying <strong>the</strong> <strong>data</strong>base an easier<br />

process. These views are ei<strong>the</strong>r <strong>from</strong> <strong>the</strong>:<br />

• Finance <strong>data</strong>base, as outlined below.<br />

• Main <strong>Synergetic</strong> <strong>data</strong>base. See Main <strong>Synergetic</strong> views (on page 7).<br />

Additional <strong>data</strong> is sometimes also retrieved <strong>from</strong> <strong>the</strong> main <strong>Synergetic</strong> <strong>data</strong>base to complement <strong>the</strong><br />

Finance <strong>data</strong>.<br />

Users will need to have security permission to <strong>the</strong>:<br />

• SynergyOneFinance <strong>data</strong>base<br />

• finance tables and views.<br />

View name Description Base tables used<br />

vAssets<br />

vAssetDepreciation<br />

Use this view to obtain listings of assets that exist<br />

within Asset Register Maintenance.<br />

For example, you could get a listing of all assets<br />

of a certain asset type:<br />

SELECT * FROM vAssets<br />

WHERE AssetTypeCode = 'Car'<br />

Use this view to obtain:<br />

• a list of assets for a depreciation posting<br />

• <strong>the</strong> amount that <strong>the</strong>y depreciated by.<br />

• Assets<br />

• AssetDefinitions<br />

• Community<br />

• Addresses<br />

• FinanceConfig<br />

• vAssets<br />

• AssetDepreciation<br />

• GeneralLedger-<br />

PostingControl<br />

vBankReconciliation Use this view to list all unreconciled cheques that<br />

have not been cancelled.<br />

The Bank Reconciliation Crystal Report for<br />

example, uses this view by:<br />

• getting <strong>the</strong><br />

GeneralLedgerReportingMonthEnd-<br />

Date, defined in Finance Configuration<br />

Maintenance<br />

• BankingConfig<br />

• GeneralLedgerBank-<br />

Transactions<br />

• GeneralLedger<br />

• FinanceConfig<br />

• including any cheques or payments that<br />

have not yet been reconciled or<br />

cancelled before that date.<br />

vCashReceiptsEntry Use this view to list all receipts that have been<br />

processed. The view includes:<br />

• payment type<br />

• origin<br />

• amount.<br />

• GeneralLedger-<br />

Journals<br />

• GeneralLedger<br />

• luGeneralLedger-<br />

RcptAllocations<br />

• Receipts<br />

Version 60 Page 6-19


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

View name Description Base tables used<br />

vCreditorInvoice-<br />

Entry<br />

Use this view to list all invoices that have been<br />

entered through Creditor Invoice Entry.<br />

• CreditorTransactions<br />

• FinanceConfig<br />

• Creditors<br />

• Community<br />

• GeneralLedger-<br />

Journals<br />

• GeneralLedger<br />

vCreditorInvoices Use this view to list all creditor invoices. • CreditorTransactions<br />

• Creditors<br />

• Community<br />

• Addresses<br />

• GeneralLedger-<br />

PostingControl<br />

vCreditors<br />

vCreditor-<br />

Transactions<br />

vDebtorActive-<br />

Arrangements<br />

Use this view to list all current creditors and<br />

relevant information about <strong>the</strong>m.<br />

This information comes straight <strong>from</strong> <strong>the</strong> base<br />

table so whatever is in Creditor Maintenance<br />

will appear in a listing with this view.<br />

Use this view to list all creditor invoices and<br />

payments. That is, transactions.<br />

Use this view to view active debtor arrangements.<br />

Includes:<br />

• arrangements that are not yet complete<br />

• <strong>the</strong> oldest outstanding transaction date<br />

• all of <strong>the</strong> information <strong>from</strong> vDebtors,<br />

covered below.<br />

• Creditors<br />

• CreditorTransactions<br />

• FinanceConfig<br />

• Community<br />

• Creditors<br />

• Addresses<br />

• GeneralLedger<br />

• GeneralLedger-<br />

Journals<br />

• GeneralLedger-<br />

PostingControl<br />

• vDebtors<br />

• Community<br />

• Addresses<br />

Page 6-20 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

View name Description Base tables used<br />

vDebtorInstalments<br />

Students<br />

vDebtors<br />

vDebtorSibling-<br />

Discounts<br />

vDebtorStudentCon<br />

cessions<br />

vDebtorTransaction<br />

Address<br />

Use this view to summarise debtor instalments.<br />

Includes:<br />

• debtor information<br />

• fee code<br />

• total amount due or paid<br />

• instalment setup details.<br />

Use this view to list debtor contact information,<br />

including:<br />

• spouse contact details<br />

• previous payment summary<br />

• current balances.<br />

Use this view to include all tuition-related sibling<br />

discounts that have not yet appeared on a<br />

statement.<br />

Also only gives a listing of sibling discounts<br />

where <strong>the</strong>re is more than one student in any one<br />

family at <strong>the</strong> school.<br />

Use this view to list all student concessions that<br />

are currently listed for <strong>the</strong> student and <strong>the</strong>ir<br />

related debtor.<br />

All <strong>data</strong> <strong>from</strong> <strong>the</strong> Concessions tab of Current<br />

Student Maintenance is included in <strong>the</strong> view.<br />

See Current Student Maintenance - Concessions<br />

tab in <strong>the</strong> Current Students manual.<br />

Use this view to list all debtor charges and<br />

receipts.<br />

• DebtorInstalments<br />

• DebtorFees<br />

• Community<br />

• Debtors<br />

• Community<br />

• Addresses<br />

• DebtorTransactions<br />

• Debtors<br />

• DebtorFees<br />

• luAutoTuition<br />

• Students<br />

• Community<br />

• DebtorFees<br />

• DebtorStudent-<br />

Concessions<br />

• vStudents<br />

• Debtors<br />

• DebtorTransactions<br />

• Community<br />

• Addresses<br />

• DebtorFees<br />

Version 60 Page 6-21


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

View name Description Base tables used<br />

vEnrolmentDeposits Use this view to list all current enrolment<br />

deposits, along with:<br />

• student information<br />

• contact or payee information.<br />

• EnrolmentDeposits<br />

• EnrolmentDeposit-<br />

Definitions<br />

• PastStudents<br />

vFinanceReport<br />

vGeneralLedgerJnl-<br />

BudgetTotal<br />

vGeneralLedger-<br />

Journals<br />

vGLMonthly-<br />

MovementIn-<br />

Columns<br />

Use this view to get a hard-copy of any of your<br />

finance reports.<br />

For example, <strong>the</strong> G/L Finance Report Structure<br />

report primarily uses this view.<br />

Use this view to list all account budgets against<br />

actual expenses.<br />

Use this view to list all journals that have been<br />

posted to <strong>the</strong> general ledger <strong>from</strong> any of <strong>the</strong><br />

finance modules within <strong>Synergetic</strong>.<br />

Use this view to get total expenses for general<br />

ledger accounts in each period for <strong>the</strong> specified<br />

general ledger reporting year.<br />

The GLReportingGLYear value can be set on<br />

<strong>the</strong> General tab of Finance Configuration<br />

Maintenance. If required, change <strong>the</strong> G/L<br />

Reporting End Date field on <strong>the</strong> tab.<br />

See Finance Configuration Maintenance -<br />

General tab in <strong>the</strong> System maintenance manual.<br />

• Students<br />

• FutureStudents<br />

• StudentSemester<br />

• Community<br />

• Addresses<br />

• GeneralLedger-<br />

FinanceReports<br />

• GeneralLedger-<br />

FinanceReportLinks<br />

• luGeneralLedger-<br />

FinanceReport<br />

• GeneralLedger<br />

• GeneralLedger<br />

• GeneralLedger-<br />

MonthlyBudgets<br />

• GeneralLedger-<br />

Journals<br />

• GeneralLedger<br />

• GeneralLedger-<br />

Journals<br />

• GeneralLedger-<br />

PostingControl<br />

• General Ledger<br />

• FinanceConfig<br />

Page 6-22 Version 60


<strong>Synergetic</strong> views<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

View name Description Base tables used<br />

vGLReportingMonth<br />

Summary<br />

vItemSales<br />

vItemStock<br />

vPayrollEmployee-<br />

PayDetails<br />

vPayrollEmployee-<br />

PayDetailTots<br />

Use this view to show <strong>the</strong> following details for<br />

your general ledger accounts:<br />

• opening balance<br />

• year-to-date<br />

• current and full year expense figures<br />

• current and full year budget figures.<br />

Use this view to list every sale made and <strong>the</strong><br />

person or general ledger code that <strong>the</strong> item went<br />

to.<br />

Use this view to list all items and <strong>the</strong> amount of<br />

stock on hand at each business unit.<br />

Use this view to get pay details by line, for each<br />

employee’s pay for a given pay posting.<br />

Use this view to get totals for each PayCode by<br />

posting number.<br />

This view is:<br />

• useful for analysing an overall pay run<br />

• not useful for individual employee totals<br />

• used for <strong>the</strong> totals in <strong>the</strong> Payroll Journal<br />

Listing report.<br />

• GeneralLedger<br />

• FinanceConfig<br />

• GeneralLedger-<br />

AllocationCodes<br />

• ItemSales<br />

• Students<br />

• ItemSaleDetails<br />

• Community<br />

• Items<br />

• vDebtors<br />

• GeneralLedger-<br />

PostingControl<br />

• Items<br />

• ItemStock<br />

• PayrollEmployee-<br />

PayDetails<br />

• PayrollEmployees<br />

• PayrollPayGroups<br />

• PayrollCode-<br />

Definitions<br />

• GeneralLedger-<br />

PostingControl<br />

• Community<br />

• luPayroll-<br />

SuperannuationList<br />

• PayrollEmployee-<br />

PayDetails<br />

• PayrollCode-<br />

Definitions<br />

Version 60 Page 6-23


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Synergetic</strong> views<br />

View name Description Base tables used<br />

vPayrollEmployees<br />

vPurchaseOrders<br />

Use this view to extract all payroll employee<br />

information. It:<br />

• includes <strong>the</strong> year-to-date pay figure<br />

• includes <strong>the</strong> total pay figure<br />

• does not provide information about each<br />

line of pay.<br />

For information about each line of pay, see <strong>the</strong><br />

vPayrollEmployeePayDetails view, covered<br />

earlier.<br />

Use this view to extract all of <strong>the</strong> details in<br />

Purchase Order Maintenance.<br />

Every purchase detail will return a record in a<br />

query <strong>from</strong> this view.<br />

• PayrollEmployees<br />

• Community<br />

• Addresses<br />

• PayrollPayGroups<br />

• luPayrollTaxationRate<br />

• luPayrollPay-<br />

Frequency<br />

• PurchaseOrders<br />

• GeneralLedger-<br />

AllocationCodes<br />

• BusinessUnits<br />

• PurchaseOrderDetails<br />

• Community<br />

• Items<br />

• Addresses<br />

• FinanceConfig<br />

• luDeliveryPoint<br />

Page 6-24 Version 60


<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

The following example shows how to extract student names and contact details <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong><br />

<strong>data</strong>base using <strong>the</strong> Microsoft Query wizard.<br />

1. Start Microsoft Excel.<br />

2. Select:<br />

• Data > Import External Data > New Database Query (Microsoft Excel 2007)<br />

• Data > Import External Data > New Database Query (Microsoft Excel 2003)<br />

• Data > Get External Data > Create New Query (Microsoft Excel 97).<br />

The Choose Data Source window is displayed.<br />

3. Select <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base you plan to use. That is:<br />

• SynergyOne for mostly non-financial <strong>data</strong><br />

• SynergyOneFinance for finance <strong>data</strong>.<br />

4. Select <strong>the</strong> Use <strong>the</strong> Query Wizard to create/edit queries field.<br />

Version 60 Page 6-25


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

5. Click .<br />

The SQL Server Login window is displayed.<br />

6. Type in your username and password.<br />

Note: This is your usual <strong>Synergetic</strong> username and password.<br />

7. Click .<br />

The Query Wizard - Choose Columns window is displayed.<br />

8. Scroll down <strong>the</strong> list of tables until you get to <strong>the</strong> views. These all start with a small v.<br />

Tip: If you are using SQL 2005 you can limit <strong>the</strong> number of Available tables and columns<br />

displayed by clicking<br />

<strong>the</strong>n selecting dbo <strong>from</strong> <strong>the</strong> Owner drop down list.<br />

Page 6-26 Version 60


<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

9. Click <strong>the</strong> to <strong>the</strong> left of <strong>the</strong> selected view to list all fields that this view is contains. For example,<br />

vStudentContactAddress.<br />

10. To select fields, highlight <strong>the</strong>m <strong>the</strong>n click .<br />

Note: If you click this button while <strong>the</strong> view name is selected <strong>the</strong>n all fields in this view will be<br />

added to <strong>the</strong> columns in your query. However, you rarely need to use all of <strong>the</strong> fields in a view or<br />

base table.<br />

11. To follow this example, select <strong>the</strong> fields as shown in <strong>the</strong> screen capture below.<br />

Note: Scroll down in <strong>the</strong> Available tables and columns area to find each of <strong>the</strong> fields.<br />

Note: See <strong>the</strong> Useful fields section below.<br />

12. Repeat steps 10 and 11 until no more fields (columns) are required.<br />

Version 60 Page 6-27


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

13. Click .<br />

The Query Wizard - Filter Data window is displayed.<br />

Tip: You can also come back to this screen at any time by clicking<br />

using <strong>the</strong> wizard.<br />

while you are still<br />

14. Select <strong>the</strong> field (column) to filter on and <strong>the</strong> selection criteria. For example, you can enter <strong>the</strong><br />

following selection criteria, CurrentSemesterOnlyFlag equals 1 to retrieve records for <strong>the</strong> current<br />

year and semester. In <strong>the</strong> following example, <strong>the</strong> first selection criteria set is FileYear equals<br />

2006.<br />

Tip: If <strong>the</strong> view contains <strong>the</strong> CurrentSemesterOnly flag, you can use this instead of FileYear and<br />

FileSemester fields.<br />

Note: When you choose your filter <strong>the</strong> Column Name becomes bold, this will let you know what<br />

fields you have already applied filters to.<br />

Page 6-28 Version 60


<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

15. Click .<br />

The Query Wizard - Sort Order window is displayed.<br />

16. Select <strong>the</strong> field to base <strong>the</strong> sorting <strong>data</strong> on. You can choose multiple fields to sort by but Surname<br />

is usually a good option.<br />

For example, click <strong>the</strong> drop down menu and select Surname. Leave <strong>the</strong> sort type as Ascending.<br />

Note: Ascending order is A-Z, descending order is Z-A.<br />

Version 60 Page 6-29


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

17. Click .<br />

The Query Wizard - Finish window is displayed.<br />

18. Click , if you plan to reuse this query at a later date.<br />

The Save As window is displayed.<br />

19. Name <strong>the</strong> query using a suitable name, such as vStudentContactAddress.<br />

20. Click .<br />

The Query Wizard - Finish window is redisplayed.<br />

21. Select Return Data to Microsoft Office Excel.<br />

22. Click .<br />

Page 6-30 Version 60


<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

23. Switch back to Microsoft Excel.<br />

The Import Data window is displayed.<br />

24. Select <strong>the</strong> starting position on <strong>the</strong> spreadsheet.<br />

25. Click .<br />

The <strong>data</strong> is retrieved and placed in <strong>the</strong> spreadsheet.<br />

26. Save <strong>the</strong> spreadsheet.<br />

Version 60 Page 6-31


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

27. You can edit <strong>the</strong> query in one of two ways:<br />

• Editing <strong>the</strong> query using <strong>the</strong> wizard. See Editing a Microsoft Query using <strong>the</strong> wizard (on<br />

page 35).<br />

• Editing <strong>the</strong> query directly using <strong>the</strong> Query window. See <strong>Extracting</strong> student name and contact<br />

details example (on page 51).<br />

Tip: Select Data >Import External Data > Data Range (Microsoft Excel 2003) to edit additional<br />

query settings.<br />

Page 6-32 Version 60


<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Useful fields<br />

The following fields are useful when querying Current Student views using <strong>the</strong> Microsoft Query<br />

wizard:<br />

For information on o<strong>the</strong>r useful fields and generated fields, see <strong>Synergetic</strong> views (on page 5).<br />

Field<br />

CurrentSemesterOnlyFlag<br />

FileYear<br />

File Semester<br />

ContactAddressFull<br />

StudentContactAddressComma<br />

StudentContactMailName<br />

StudentContactMailSalutation<br />

Surname<br />

Description<br />

Only view <strong>data</strong> <strong>from</strong> <strong>the</strong> current year and semester. The<br />

default value in this field changes depending on <strong>the</strong> user’s<br />

<strong>Synergetic</strong> preferences.<br />

It is preferable to use <strong>the</strong> CurrentSemesterOnlyFlag ra<strong>the</strong>r<br />

than FileYear and FileSemester fields.<br />

Use to set <strong>the</strong> current year, to avoid using information <strong>from</strong><br />

previous or future years.<br />

Use to set <strong>the</strong> current semester, to avoid using information<br />

<strong>from</strong> previous or future semesters.<br />

For example, when using FileYear and FileSemester:<br />

If using <strong>the</strong> same query three years <strong>from</strong> <strong>the</strong> date of<br />

creation, you will need to reset <strong>the</strong>se filters to match <strong>the</strong><br />

current year and semester. These selections would only be<br />

useful if you want to access prior years on <strong>the</strong> <strong>data</strong>base.<br />

Gets <strong>the</strong> contact’s address and organises it in a mailing<br />

format such as:<br />

Computing Directions Australia<br />

Building 4, 303-313 Burwood Hwy<br />

Burwood East VIC 3151<br />

Places commas in <strong>the</strong> address, used for listing names and<br />

addresses. For example:<br />

Computing Directions Australia, Building 4, 303-313<br />

Burwood Hwy, Burwood East VIC 3151<br />

These fields are constructed <strong>from</strong> <strong>the</strong> Address1-3, Suburb,<br />

State, PostCode and Country. They also take into account<br />

whe<strong>the</strong>r <strong>the</strong> current person is deceased or <strong>the</strong> address is no<br />

longer valid on <strong>the</strong> system.<br />

Defined by <strong>the</strong> MailFormat in Community Maintenance,<br />

this field is normally in <strong>the</strong> format of Contact Title and<br />

Contact Spouse Title Contact First Initial Surname.<br />

For example, Mr and Mrs P Bailey.<br />

Organises <strong>the</strong> ContactMailName in <strong>the</strong> format you have<br />

specified within <strong>Synergetic</strong>’s Community Maintenance,<br />

MailSalutation.<br />

For example, you can remove <strong>the</strong> contact’s initial.<br />

Used for sorting purposes.<br />

You can later delete <strong>the</strong> field but keep <strong>the</strong> sorting. If you are<br />

using <strong>the</strong> wizard <strong>the</strong>n you need to add it now.<br />

Version 60 Page 6-33


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard<br />

Field<br />

StudentName<br />

EntryDate / LeavingDate<br />

Description<br />

Student’s Name and Surname joined toge<strong>the</strong>r. It will be<br />

used later when doing a Mail Merge within Word.<br />

If you want only <strong>the</strong> student’s preferred name <strong>the</strong>n you may<br />

need to join to ano<strong>the</strong>r table or select a different field in <strong>the</strong><br />

view. For example, Brian Smith.<br />

The EntryDate and LeavingDate are used toge<strong>the</strong>r to filter<br />

out students who are not at your organisation at a certain<br />

date.<br />

All students should have an entry date, after which date <strong>the</strong>y<br />

are present at your organisation, unless <strong>the</strong>y have left.<br />

Page 6-34 Version 60


Editing a Microsoft Query using <strong>the</strong> wizard<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Editing a Microsoft Query using <strong>the</strong> wizard<br />

The following example shows how to edit an existing query using <strong>the</strong> Query wizard, accessed <strong>from</strong> <strong>the</strong><br />

Microsoft Excel spreadsheet created earlier.<br />

Also, see:<br />

• <strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard (on page 25)<br />

• Common duplication problems (on page 38).<br />

To edit an existing query using <strong>the</strong> Query wizard:<br />

1. Open <strong>the</strong> Microsoft Excel spreadsheet.<br />

2. Open <strong>the</strong> Query wizard. You can:<br />

• select Data > Import External Data > Edit Query (Microsoft Excel 2003)<br />

• click on <strong>the</strong> External Data toolbar<br />

Version 60 Page 6-35


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Editing a Microsoft Query using <strong>the</strong> wizard<br />

• right click on one of <strong>the</strong> populated cells and select Edit Query <strong>from</strong> <strong>the</strong> menu.<br />

Note: You can also refresh your <strong>data</strong>set by selecting Refresh Data.<br />

The SQL Server Login window is displayed.<br />

3. Type in your username and password.<br />

Note: This is your usual <strong>Synergetic</strong> username and password.<br />

Page 6-36 Version 60


Editing a Microsoft Query using <strong>the</strong> wizard<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

4. Click .<br />

The Query Wizard - Choose Columns window is displayed.<br />

5. Update <strong>the</strong> query using <strong>the</strong> Query Wizard windows. See <strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft<br />

Query wizard (on page 25).<br />

6. Click .<br />

The Query Wizard - Finish window is displayed.<br />

7. Select Return Data to Microsoft Office Excel.<br />

8. Click .<br />

9. Switch back to Microsoft Excel.<br />

The <strong>data</strong>set is refreshed with <strong>the</strong> latest parameters.<br />

Version 60 Page 6-37


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Common duplication problems<br />

Common duplication problems<br />

Example 1<br />

Duplicate names can be caused by forgetting to select StudentContactType as SC1 so that you are<br />

only picking up <strong>the</strong> primary contacts and not Term and Alternate as well. O<strong>the</strong>rwise, you would be<br />

returning one line for every contact that a student has.<br />

Query with duplicate records<br />

SELECT ID, StudentContactMailName, StudentContactAddressComma, StudentContactType<br />

FROM vStudentContactAddress<br />

WHERE CurrentSemesterOnlyFlag = 1<br />

Returns<br />

ID ContactMailName ContactAddress ContactType<br />

364 Mr Joe Black 15 Green St, MT WAVERLEY VIC 3149 SC1<br />

364 Mrs Jane Black 341 Flowerdale Ave, St Kilda VIC 3182 SC2<br />

Query with correction<br />

SELECT ID, StudentContactMailName, StudentContactAddressComma, StudentContactType<br />

FROM vStudentContactAddress, StudentContact<br />

WHERE CurrentSemesterOnlyFlag = 1 AND NormalMailFlag = 1<br />

Returns<br />

ID ContactMailName ContactAddress ContactType<br />

364 Mr Joe Black 15 Green St, MT WAVERLEY VIC 3149 SC1<br />

Page 6-38 Version 60


Common duplication problems<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Example 2<br />

Ano<strong>the</strong>r cause of duplication in a student contact query comes <strong>from</strong> <strong>the</strong> selection of any student fields.<br />

For example, you want to mail out one letter to <strong>the</strong> parents of students, regardless of whe<strong>the</strong>r <strong>the</strong>y<br />

have multiple siblings at <strong>the</strong> school. You also decide that you want to sort by YearLevel so you use<br />

this field as well.<br />

To adjust <strong>the</strong> query to avoid duplications because siblings may be in different year levels, you need to<br />

add <strong>the</strong>:<br />

• YearLevel field to <strong>the</strong> query<br />

• key word DISTINCT.<br />

Query with correction<br />

SELECT DISTINCT StudentContactMailName, StudentContactAddressComma, YearLevel<br />

FROM vStudentContactAddress<br />

WHERE StudentContactNormalMailFlag = 1 AND<br />

CurrentSemesterOnlyFlag = 1<br />

Returns<br />

ContactMailName ContactAddress YearLevel<br />

Mr Joe Black 15 Green St, MT WAVERLEY VIC 3149 5<br />

Mr Joe Black 15 Green St, MT WAVERLEY VIC 3149 10<br />

Version 60 Page 6-39


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Inserting an existing SQL statement<br />

Inserting an existing SQL statement<br />

Sometimes you may have a query that has already been perfected on ano<strong>the</strong>r system. You can ei<strong>the</strong>r:<br />

• Open <strong>the</strong> query file that has been provided or saved with an .dqy extension.<br />

• Paste a SQL statement into <strong>the</strong> SQL window on <strong>the</strong> Microsoft Query window.<br />

In this example, we will follow <strong>the</strong> process when someone <strong>from</strong> <strong>the</strong> Computing Directions Australia<br />

(CDA) team e-mails you a SQL statement. This Structured Query Language (SQL) statement is written<br />

in a language that <strong>data</strong>base management systems can interpret. <strong>Synergetic</strong> uses <strong>the</strong> Microsoft SQL<br />

Server <strong>data</strong>base management system.<br />

In this example, we will use a simple SQL statement that will report and total all religion codes at your<br />

organisation:<br />

Query<br />

SELECT vStudents.StudentCampus, vStudents.StudentReligionCode, Count(*)<br />

FROM SynergyOne.dbo.vStudents vStudents<br />

WHERE (vStudents.CurrentSemesterOnlyFlag=1)<br />

GROUP BY vStudents.StudentCampus, vStudents.StudentReligionCode<br />

ORDER BY vStudents.StudentCampus, vStudents.StudentReligionCode<br />

This statement selects campus, religion code and places a count field on your spreadsheet. The fields:<br />

• to be returned or calculated are placed directly after <strong>the</strong> SELECT clause<br />

• used to filter <strong>the</strong> records are placed directly after <strong>the</strong> WHERE clause<br />

• used to group <strong>the</strong> output are placed after <strong>the</strong> GROUP BY clause<br />

• used to sort <strong>the</strong> information are placed after <strong>the</strong> ORDER BY clause.<br />

Page 6-40 Version 60


Inserting an existing SQL statement<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

To paste in a SQL statement that has been sent to you by e-mail:<br />

1. Start Microsoft Excel.<br />

2. Select:<br />

• Data > Import External Data > New Database Query (Microsoft Excel 2007)<br />

• Data > Import > Import External Data > New Database Query (Microsoft Excel 2003)<br />

• Data > Get External Data > Create New Query (Microsoft Excel 97).<br />

The Choose Data Source window is displayed.<br />

3. Select <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base you plan to use. That is:<br />

• SynergyOne for mostly non-financial <strong>data</strong><br />

• SynergyOneFinance for finance <strong>data</strong>.<br />

4. Clear <strong>the</strong> Use <strong>the</strong> Query Wizard to create/edit queries field.<br />

Version 60 Page 6-41


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Inserting an existing SQL statement<br />

5. Click .<br />

The SQL Server Login window is displayed.<br />

6. Type in your username and password.<br />

Note: This is your usual <strong>Synergetic</strong> username and password.<br />

7. Click .<br />

The Add Tables window is displayed.<br />

8. Click .<br />

Page 6-42 Version 60


Inserting an existing SQL statement<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

9. Click .<br />

The SQL window is displayed.<br />

10. Switch to <strong>the</strong> application with <strong>the</strong> SQL statement, such as an e-mail message.<br />

11. Select <strong>the</strong> SQL statement text and press Ctrl + C.<br />

The SQL statement is copied to <strong>the</strong> clipboard.<br />

12. Switch back to <strong>the</strong> SQL window.<br />

13. Press Ctrl + V.<br />

The SQL statement is pasted into <strong>the</strong> SQL window.<br />

Version 60 Page 6-43


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Inserting an existing SQL statement<br />

14. Click .<br />

The Microsoft Query window is updated with <strong>the</strong> new criteria and <strong>the</strong> records are displayed.<br />

Page 6-44 Version 60


Inserting an existing SQL statement<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

15. You can:<br />

• select File > Save to save <strong>the</strong> query for later use<br />

• select File > Return Data to Microsoft Office Excel to return <strong>the</strong> <strong>data</strong> to a spreadsheet.<br />

Version 60 Page 6-45


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

Most of <strong>the</strong> time <strong>the</strong> Query wizard can mislead you and make it harder to manipulate your <strong>data</strong>. It is<br />

used mainly for creating quick queries but does not introduce you to <strong>the</strong> full functionality of Microsoft<br />

Query.<br />

Everything that you can do in <strong>the</strong> wizard (and more) can be done in Microsoft Query itself. Check <strong>the</strong><br />

Help available for Microsoft Query. Also, see:<br />

• <strong>Extracting</strong> student name and contact details example (on page 51)<br />

• Common duplication problems (on page 38).<br />

Page 6-46 Version 60


<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Useful fields<br />

The following fields are useful when querying Current Student views using Microsoft Query directly:<br />

For information on o<strong>the</strong>r useful fields and generated fields, see <strong>Synergetic</strong> views (on page 5).<br />

Field<br />

CurrentSemesterOnlyFlag<br />

FileYear<br />

File Semester<br />

ContactAddressFull<br />

StudentContactAddressComma<br />

StudentContactMailName<br />

StudentContactMailSalutation<br />

Surname<br />

Description<br />

Only view <strong>data</strong> <strong>from</strong> <strong>the</strong> current year and semester. The<br />

default value in this field changes depending on <strong>the</strong> user’s<br />

<strong>Synergetic</strong> preferences.<br />

It is preferable to use <strong>the</strong> CurrentSemesterOnlyFlag ra<strong>the</strong>r<br />

than FileYear and FileSemester fields.<br />

Use to set <strong>the</strong> current year, to avoid using information <strong>from</strong><br />

previous or future years.<br />

Use to set <strong>the</strong> current semester, to avoid using information<br />

<strong>from</strong> previous or future semesters.<br />

For example, when using FileYear and FileSemester:<br />

If using <strong>the</strong> same query three years <strong>from</strong> <strong>the</strong> date of<br />

creation, you will need to reset <strong>the</strong>se filters to match <strong>the</strong><br />

current year and semester. These selections would only be<br />

useful if you want to access prior years on <strong>the</strong> <strong>data</strong>base.<br />

Gets <strong>the</strong> contact’s address and organises it in a mailing<br />

format such as:<br />

Computing Directions Australia<br />

Building 4, 303-313 Burwood Hwy<br />

Burwood East VIC 3151<br />

Places commas in <strong>the</strong> address, used for listing names and<br />

addresses. For example:<br />

Computing Directions Australia, Building 4, 303-313<br />

Burwood Hwy, Burwood East VIC 3151<br />

These fields are constructed <strong>from</strong> <strong>the</strong> Address1-3, Suburb,<br />

State, PostCode and Country. They also take into account<br />

whe<strong>the</strong>r <strong>the</strong> current person is deceased or <strong>the</strong> address is no<br />

longer valid on <strong>the</strong> system.<br />

Defined by <strong>the</strong> MailFormat in Community Maintenance,<br />

this field is normally in <strong>the</strong> format of Contact Title and<br />

Contact Spouse Title Contact First Initial Surname.<br />

For example, Mr and Mrs P Bailey.<br />

Organises <strong>the</strong> ContactMailName in <strong>the</strong> format you have<br />

specified within <strong>Synergetic</strong>’s Community Maintenance,<br />

MailSalutation.<br />

For example, you can remove <strong>the</strong> contact’s initial.<br />

Used for sorting purposes.<br />

You can later delete <strong>the</strong> field but keep <strong>the</strong> sorting. If you are<br />

using <strong>the</strong> wizard <strong>the</strong>n you need to add it now.<br />

Version 60 Page 6-47


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

Field<br />

StudentName<br />

EntryDate / LeavingDate<br />

Description<br />

Student’s Name and Surname joined toge<strong>the</strong>r. It will be<br />

used later when doing a Mail Merge within Word.<br />

If you want only <strong>the</strong> student’s preferred name <strong>the</strong>n you may<br />

need to join to ano<strong>the</strong>r table or select a different field in <strong>the</strong><br />

view. For example, Brian Smith.<br />

The EntryDate and LeavingDate are used toge<strong>the</strong>r to filter<br />

out students who are not at your organisation at a certain<br />

date.<br />

All students should have an entry date, after which date <strong>the</strong>y<br />

are present at your organisation, unless <strong>the</strong>y have left.<br />

Page 6-48 Version 60


<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

E-mailing your query to CDA<br />

If you are having problems with your query <strong>the</strong>n:<br />

• copy <strong>the</strong> query into an e-mail<br />

• provide details on <strong>the</strong> objective of <strong>the</strong> query<br />

• provide information about <strong>the</strong> problem that you are encountering<br />

• send <strong>the</strong> email to support@cda.com.au.<br />

To prepare <strong>the</strong> information for Computing Directions Australia (CDA):<br />

1. Open <strong>the</strong> query using Microsoft Query.<br />

The Microsoft Query window is displayed.<br />

Version 60 Page 6-49


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

2. Click .<br />

The SQL window is displayed.<br />

3. Highlight <strong>the</strong> SQL statement.<br />

4. Press Ctrl + C to copy <strong>the</strong> SQL statement to <strong>the</strong> clipboard.<br />

5. Switch to e-mail.<br />

6. Press Ctrl + V to paste <strong>the</strong> SQL statement into <strong>the</strong> e-mail message.<br />

7. Complete <strong>the</strong> e-mail and send it. Provide:<br />

• details on <strong>the</strong> objective of <strong>the</strong> query<br />

• information about <strong>the</strong> problem that you are encountering.<br />

Page 6-50 Version 60


<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> student name and contact details example<br />

The following example shows how to extract student names and contact details <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong><br />

<strong>data</strong>base directly using Microsoft Query.<br />

Also, see:<br />

• <strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly (on page 46)<br />

• Common duplication problems (on page 38).<br />

To create a new query using Microsoft Query directly:<br />

1. Start Microsoft Excel.<br />

2. Select:<br />

• Data > Import External Data > New Database Query (Microsoft Excel 2007)<br />

• Data > Import External Data > New Database Query (Microsoft Excel 2003)<br />

• Data > Get External Data > Create New Query (Microsoft Excel 97).<br />

The Choose Data Source window is displayed.<br />

3. Select <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base you plan to use. That is:<br />

• SynergyOne for mostly non-financial <strong>data</strong><br />

• SynergyOneFinance for finance <strong>data</strong>.<br />

Version 60 Page 6-51


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

4. Clear <strong>the</strong> Use <strong>the</strong> Query Wizard to create/edit queries field.<br />

5. Click .<br />

The SQL Server Login window is displayed.<br />

6. Type in your username and password.<br />

Note: This is your usual <strong>Synergetic</strong> username and password.<br />

7. Click .<br />

The Add Tables window is displayed.<br />

Page 6-52 Version 60


<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

8. Scroll down <strong>the</strong> list of tables until you get to <strong>the</strong> Views. These all start with a small v.<br />

Tip: Press v on <strong>the</strong> keyboard to position at <strong>the</strong> first view.<br />

Note: If you only need <strong>the</strong> views to be displayed, click<br />

and clear all but <strong>the</strong> Views field.<br />

Also, if you are using SQL 2005 you can limit <strong>the</strong> number of entries displayed by selecting dbo<br />

<strong>from</strong> <strong>the</strong> Owner drop down list.<br />

9. Locate and select <strong>the</strong> required view.<br />

Version 60 Page 6-53


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

10. Click .<br />

The table is added to <strong>the</strong> Microsoft Query window.<br />

11. Repeat steps 9 and 10 until you have finished adding tables.<br />

Tip: To add ano<strong>the</strong>r table later, select Table > Add Tables. You may need to select a different<br />

Database, if <strong>data</strong> <strong>from</strong> <strong>the</strong> Finance <strong>data</strong>base is required.<br />

Note: In this example, we are only using views that have already been created by CDA. If you are<br />

using multiple tables <strong>the</strong>n joins need to be made between <strong>the</strong>m. Contact CDA for more<br />

information.<br />

If you want to remove a table, click on it <strong>the</strong>n press Delete on your keyboard.<br />

12. Click .<br />

Page 6-54 Version 60


<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

13. Select Criteria > Add Criteria….<br />

The Add Criteria window is displayed.<br />

14. Update <strong>the</strong> criteria fields.<br />

Note: We recommend using CurrentSemesterOnlyFlag = 1 ra<strong>the</strong>r than FileYear and<br />

FileSemester selections.<br />

Note: If you select a value <strong>from</strong> <strong>the</strong> Field drop-down list, you can choose <strong>from</strong> any field in <strong>the</strong><br />

table you have added. In <strong>the</strong> wizard you can only choose <strong>from</strong> <strong>the</strong> fields that you add <strong>from</strong> <strong>the</strong><br />

table.<br />

Tip: Click<br />

to display all values available for this field.<br />

Version 60 Page 6-55


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

15. Click .<br />

The criteria is added to <strong>the</strong> query window.<br />

Page 6-56 Version 60


<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

16. Select ei<strong>the</strong>r <strong>the</strong>:<br />

• And option, if <strong>the</strong> required <strong>data</strong> set is <strong>the</strong> filtered result of an intersection between <strong>the</strong> current<br />

and previous field selections<br />

• Or option, if <strong>the</strong> required <strong>data</strong> set is <strong>the</strong> combined result based on <strong>the</strong> current and previous<br />

field selections.<br />

17. Repeat steps 14 through 16 until <strong>the</strong>re are no more criteria to add.<br />

18. Click .<br />

Version 60 Page 6-57


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

19. Add fields to <strong>the</strong> <strong>data</strong> set. You can:<br />

• Double click <strong>the</strong> field <strong>from</strong> <strong>the</strong> table window.<br />

• Click and drag <strong>the</strong> field <strong>from</strong> <strong>the</strong> above window down to <strong>the</strong> grid to <strong>the</strong> column position where<br />

you want to place it.<br />

• Click <strong>the</strong> drop down list on a blank column heading to display a list of all fields, <strong>the</strong>n select <strong>the</strong><br />

field you want.<br />

• Click Records > Add Column, <strong>the</strong>n select <strong>the</strong> field you want and give it a heading name.<br />

Heading names of o<strong>the</strong>r fields can be changed by double clicking on <strong>the</strong> heading (grey area).<br />

The field (column) is added to your <strong>data</strong> set.<br />

Note: To remove a field, select <strong>the</strong> column heading as shown in <strong>the</strong> example above <strong>the</strong>n press<br />

<strong>the</strong> Delete key on your keyboard.<br />

Page 6-58 Version 60


<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

20. Select Records > Sort.<br />

The Sort window is displayed.<br />

21. Select a field to sort on by selecting:<br />

• <strong>the</strong> Column drop down list<br />

• ei<strong>the</strong>r Ascending or Descending.<br />

22. Click .<br />

The sort criteria is added to <strong>the</strong> Sort window.<br />

23. Repeat steps 21 and 22 until <strong>the</strong>re are no more sort selections.<br />

Note: The sort selections must already have been added to your query already.<br />

Version 60 Page 6-59


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

24. Review <strong>the</strong> <strong>data</strong> in <strong>the</strong> grid area.<br />

Note: You can adjust <strong>the</strong> height of <strong>the</strong> rows and <strong>the</strong> width of <strong>the</strong> columns so that you can view <strong>the</strong><br />

information more fully. This is done in <strong>the</strong> same manner as in Microsoft Excel by dragging <strong>the</strong><br />

column and row dividers .<br />

25. Select File > Return <strong>data</strong> to Microsoft Excel.<br />

Page 6-60 Version 60


<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

26. Switch back to Microsoft Excel.<br />

The Import Data window is displayed.<br />

27. Select <strong>the</strong> starting position on <strong>the</strong> spreadsheet.<br />

28. Click .<br />

The <strong>data</strong> is retrieved and placed in <strong>the</strong> spreadsheet.<br />

Version 60 Page 6-61


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly<br />

29. Save <strong>the</strong> spreadsheet.<br />

Tip: Select Data > Import External Data > Data Range (Microsoft Excel 2003) to edit additional<br />

query settings.<br />

Page 6-62 Version 60


Advanced Microsoft Query and SQL examples<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Advanced Microsoft Query and SQL examples<br />

Microsoft Query is a tool that is used to create SQL (Structured Query Language) statements that will<br />

extract and graphically display virtually any <strong>data</strong> that you want <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base. Crystal<br />

Reports allows you to produce similar results but allows a lot more manipulation of <strong>the</strong> <strong>data</strong> <strong>from</strong> a<br />

graphical perspective.<br />

Outlined below are some intermediate to advanced SQL statements that you can use with Microsoft<br />

Query. For more detailed information information, refer to:<br />

• <strong>the</strong> many good SQL websites available to assist learning this <strong>data</strong>base language<br />

• SQL Server Management Studio.<br />

If you have access to SQL Server Management Studio (your network administrator most likely<br />

would), you can load ei<strong>the</strong>r:<br />

• SQL Books On-line<br />

• Transact-SQL Help using SQL Query Analyser.<br />

Standard <strong>Synergetic</strong> fields used for filtering <strong>data</strong><br />

The following table lists fields useful for filtering <strong>data</strong>:<br />

Field<br />

Value<br />

DeceasedFlag 0<br />

ValidAddressFlag 1<br />

CurrentSemesterOnlyFlag 1<br />

FileYear 2009<br />

FileSemester<br />

StudentStatus<br />

1, 2, ...n<br />

LFT<br />

Note: 4 is left, 1 is normal.<br />

StudentContactType<br />

SC1, SC2 or SCT<br />

StudentContactNormalMailFlag 1<br />

Version 60 Page 6-63


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Advanced Microsoft Query and SQL examples<br />

Example 1 - Use SUBSTRING with a character string<br />

This example shows how to return only a portion of a character string.<br />

From <strong>the</strong> vStudentClasses view, this query returns records filtered based on a portion of <strong>the</strong> class<br />

code.<br />

Query<br />

SELECT<br />

vSC.StudentID, vSC.StudentSurname, vSC.StudentPreferred,<br />

vSC.StudentCampus, vSC.StudentHouse, vSC.ClassCampus, vSC.ClassCode,<br />

vSC.ClassDescription<br />

FROM vStudentClasses vSC<br />

WHERE (substring(vSC.ClassCode,1,2)='MA')<br />

ORDER BY<br />

vSC.StudentSurname,<br />

vSC.StudentPreferred<br />

The WHERE substring statement selects MA because <strong>the</strong>re is a character match starting <strong>from</strong><br />

position one which includes two characters of <strong>the</strong> class code.<br />

Page 6-64 Version 60


Advanced Microsoft Query and SQL examples<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

The following example shows you how to display <strong>the</strong> third and fourth characters of <strong>the</strong> string constant<br />

abcdef. The result set is cd.<br />

SELECT x = SUBSTRING('abcdef', 3, 2)<br />

Substring function<br />

Returns part of a character, binary, text or image expression.<br />

Syntax<br />

SUBSTRING(expression, start, length)<br />

Arguments<br />

• expression is a character string, binary string, text, image, a column, or an expression that<br />

includes a column. Do not use expressions that include aggregate functions.<br />

• start is an integer that specifies where <strong>the</strong> substring begins.<br />

• length is an integer that specifies <strong>the</strong> length of <strong>the</strong> substring (<strong>the</strong> number of characters to<br />

return).<br />

Return types<br />

Returns character <strong>data</strong> if expression is one of <strong>the</strong> supported character <strong>data</strong> types. Returns binary <strong>data</strong><br />

if expression is one of <strong>the</strong> supported binary <strong>data</strong> types.<br />

The returned string is <strong>the</strong> same type as <strong>the</strong> given expression with <strong>the</strong> exceptions shown in <strong>the</strong> table.<br />

Given expression<br />

text<br />

image<br />

ntext<br />

Return type<br />

varchar<br />

varbinary<br />

nvarchar<br />

Remarks<br />

Offsets (start and length) using <strong>the</strong> ntext, char, or varchar <strong>data</strong> types must be specified in number of<br />

characters. Offsets using <strong>the</strong> text, image, binary, or varbinary <strong>data</strong> types must be specified in number<br />

of bytes.<br />

Note: Compatibility levels can affect return values.<br />

Version 60 Page 6-65


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Advanced Microsoft Query and SQL examples<br />

Example 2 - Mail names and addresses for current parents and staff<br />

Query<br />

SELECT<br />

MailNameJoint, AddressFull<br />

FROM Community<br />

LEFT JOIN Addresses ON (<br />

WHERE<br />

Community.AddressID = Addresses.AddressID)<br />

EXISTS (SELECT * <strong>from</strong> Constituencies<br />

WHERE Community.ID = Constituencies.ID<br />

AND ConstitCode = '@PC')<br />

AND EXISTS (SELECT * <strong>from</strong> Constituencies<br />

AND DeceasedFlag = 0<br />

WHERE Community.ID = Constituencies.ID AND ConstitCode = '@STF')<br />

AND ValidAddressFlag = 1<br />

AND SpouseFlag = 0<br />

Points to note:<br />

• [NOT] EXISTS specifies <strong>the</strong> search for an expression, based on <strong>the</strong> expression’s inclusion or<br />

exclusion <strong>from</strong> a list. The search expression can be a constant or a column name, and <strong>the</strong> list<br />

can be a set of constants or, more commonly, a sub query. Enclose <strong>the</strong> list of values in<br />

paren<strong>the</strong>ses.<br />

Page 6-66 Version 60


Advanced Microsoft Query and SQL examples<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Example 3 - All parents who are also staff members (primary or spouse)<br />

Query<br />

SELECT DISTINCT<br />

StudentContactMailName, StudentContactAddressFull<br />

FROM vStudentContactAddress<br />

LEFT JOIN Community ON (<br />

StudentContactID = Community.ID)<br />

WHERE EXISTS (SELECT * FROM Constituencies<br />

WHERE vStudentContactAddress.StudentContactID = Constituencies.ID<br />

AND ConstitCode = '@STF')<br />

OR EXISTS (SELECT * <strong>from</strong> Constituencies<br />

Points to note:<br />

WHERE SpouseID = Constituencies.ID<br />

AND ConstitCode = '@STF')<br />

• DISTINCT specifies that only unique rows can appear in <strong>the</strong> returned <strong>data</strong> set. Null values are<br />

considered equal for <strong>the</strong> purposes of this keyword.<br />

• LEFT JOIN specifies that all rows <strong>from</strong> <strong>the</strong> left table that are not meeting <strong>the</strong> join condition are<br />

included in <strong>the</strong> results set, and output columns <strong>from</strong> <strong>the</strong> o<strong>the</strong>r table are set to NULL in addition<br />

to all rows returned by <strong>the</strong> inner join.<br />

• INNER JOIN specifies that all records that meet <strong>the</strong> join condition on both sides are included<br />

in <strong>the</strong> results set.<br />

Version 60 Page 6-67


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Advanced Microsoft Query and SQL examples<br />

Example 4 - Selecting records in Microsoft Query on <strong>the</strong> basis of date fields<br />

Select enquiries in <strong>the</strong> last 7 days:<br />

Query<br />

SELECT<br />

vEnquiryContactAddress.EnquiryID, vEnquiryContactAddress.EnquiryDate<br />

FROM vEnquiryContactAddress<br />

WHERE<br />

{fn TIMESTAMPDIFF(SQL_TSI_DAY, {fn CURDATE()},<br />

vEnquiryContactAddress.EnquiryDate)} > -6<br />

Points to note:<br />

• The –6 means 'select all enquiries for today plus <strong>the</strong> last 7 days'. Change <strong>the</strong> –6 to 0 for<br />

TODAY only. You can change to any o<strong>the</strong>r value to select enquiries <strong>from</strong> that many days<br />

ago. You MUST enter <strong>the</strong> number of days with <strong>the</strong> minus sign (means PRIOR to today).<br />

Page 6-68 Version 60


Advanced Microsoft Query and SQL examples<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Example 5 - Selecting students who have siblings at <strong>the</strong> school<br />

What factor determines siblings? Answer: Primary Contact<br />

The primary contact is <strong>the</strong> person or primary person of a couple who is <strong>the</strong> main responsible person<br />

for <strong>the</strong> child, as far as your organisation is concerned.<br />

The child does not necessarily need to live at <strong>the</strong> address. That is <strong>the</strong> meaning of <strong>the</strong> term contact<br />

and it is normally <strong>the</strong> case.<br />

The accounts do not need to be sent to <strong>the</strong> primary contact. That is <strong>the</strong> meaning of <strong>the</strong> debtor on <strong>the</strong><br />

Debtor tab and again, it is normally <strong>the</strong> case.<br />

One meaning which is attached to <strong>the</strong> primary contact is that it is <strong>the</strong> means by which <strong>Synergetic</strong> tries<br />

to work out who are siblings. That is, two students who share <strong>the</strong> same primary contact are assumed<br />

to be siblings. It does not differentiate between normal and step-siblings - that is <strong>the</strong> purpose of<br />

relationships. It is used for <strong>the</strong> following purposes:<br />

• Determining family position. StudentFamilyPosition of 1 is always <strong>the</strong> eldest by birth date.<br />

• Determining sibling discounts for billing debtor accounts.<br />

• The Sibling tab in Current and Future Student Maintenance.<br />

The following query can be used in Microsoft Query to find all future students who have a sibling who<br />

is currently enrolled, using <strong>the</strong> definition above.<br />

Sample query<br />

Query<br />

SELECT * FROM vFutureContactAddress<br />

WHERE FutureContactID IN<br />

(SELECT StudentContactID <strong>from</strong> vStudentContactAddress<br />

WHERE StudentContactType = 'SC1'<br />

AND CurrentSemesterOnlyFlag = 1<br />

AND vStudentContactAddress.ID vFutureContactAddress.ID)<br />

AND FutureContactType = 'SC1'<br />

Version 60 Page 6-69


<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base<br />

Advanced Microsoft Query and SQL examples<br />

Example 6 - Select enrolment changes in <strong>the</strong> last seven days<br />

You can also use <strong>the</strong> following statement to select records changed during <strong>the</strong> previous day(s). This<br />

statement will only work in <strong>the</strong> current year – that is, you cannot select records changed before <strong>the</strong><br />

current year. The query uses <strong>the</strong> SQL DATEPART function to calculate <strong>the</strong> date range required.<br />

Query<br />

SELECT vFCA.FutureSurname, vFCA.FuturePreferred, vFCA.FutureGender,<br />

vFCA.FutureContactType, vFCA.FutureContactDescription, vFCA.FutureContactMailName,<br />

vFCA.FutureContactMailSalutation, vFCA.FutureContactAddressFull,<br />

vFCA.FutureApplicationDate, vFCA.FutureEnrolYear, vFCA.FutureStatus,<br />

vFCA.FutureCampus, vFCA.FutureYearLevel<br />

FROM SynergyOne.dbo.vFutureContactAddress vFCA<br />

WHERE<br />

(DATEPART(Year,FutureStatusChangeDate) >= DATEPART(Year,GETDATE())) AND<br />

(DATEPART(DayofYear,FutureStatusChangeDate) >=<br />

(DATEPART(DayofYear,GETDATE() -6))<br />

Page 6-70 Version 60


Advanced Microsoft Query and SQL examples<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Stored procedures can be used to return <strong>Synergetic</strong> <strong>data</strong> to Microsoft Word to create mail merge<br />

letters. The procedures also update <strong>Synergetic</strong> fields so that history is kept about what has been<br />

mailed when.<br />

For details of stored procedures, see Stored procedures (on page 72).<br />

How to<br />

• Add an activity for a future student, to include in a mail merge letter. See Future Student<br />

Maintenance - Activity tab in <strong>the</strong> Future students manual.<br />

• Change <strong>the</strong> status of a future student's application, to include in a mail merge letter. See<br />

Future Student Maintenance - Applications tab in <strong>the</strong> Future students manual.<br />

• Select several future students and add activities for <strong>the</strong>m. See Adding future student activity in<br />

bulk in <strong>the</strong> Future students manual.<br />

• Create new mail merge letters. See Creating mail merge letters using stored procedures (on<br />

page 73).<br />

• Print using existing mail merge letters. See Printing mail merge letters using an existing<br />

document (on page 82).<br />

• If you have access, reset values in bulk for <strong>the</strong> selected records in <strong>the</strong> <strong>Synergetic</strong><br />

maintenance function. See Setting field values in bulk in <strong>the</strong> Introduction manual. Alternatively,<br />

create new activities or applications.<br />

• Reprint individual letters. See Reprinting mail merge letters (on page 86).<br />

Version 60 Page 6-71


Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Advanced Microsoft Query and SQL examples<br />

Stored procedures<br />

Stored procedures have been written by <strong>Synergetic</strong> development staff to return <strong>data</strong> based on one or<br />

more defined input parameters to restrict <strong>the</strong> <strong>data</strong> returned. The following stored procedures are<br />

defined:<br />

Stored procedure Description Input parameters Fields updated<br />

crspFutureActivity-<br />

Print<br />

Return <strong>data</strong> based on<br />

certain future student<br />

activities.<br />

Optional:<br />

• Activity<br />

• Campus<br />

• MailedDate<br />

• IgnoreMailFlag*<br />

• Mailed Date<br />

• Mailed By.<br />

See Modifying Activities in<br />

<strong>the</strong> Future students<br />

manual.<br />

• ActivityCreated<br />

By.<br />

crspFutureStatus-<br />

ChangedPrint<br />

Return <strong>data</strong> based on<br />

future student enquiry<br />

or application status<br />

change.<br />

Mandatory:<br />

• MergeCode<br />

Optional:<br />

• Campus<br />

• MergePrinted-<br />

Date<br />

• Printed Date<br />

• Printed By.<br />

See Future Student<br />

Maintenance - History tab<br />

in <strong>the</strong> Future students<br />

manual.<br />

• IgnoreMailFlag*<br />

• StatusChanged-<br />

By.<br />

crspEnquiry-<br />

ProspectusPrint<br />

Return <strong>data</strong> for all<br />

enquiries that have not<br />

had a letter created to<br />

accompany your<br />

organisation's<br />

prospectus.<br />

Optional:<br />

• Campus<br />

• Prospectus-<br />

PrintedDate<br />

• Prospectus Date.<br />

See Enquiry Student<br />

Maintenance - Enquiry tab<br />

in <strong>the</strong> Future students<br />

manual.<br />

Note*: The default value for <strong>the</strong> IgnoreMailFlag parameter is 0 (zero).<br />

Page 6-72 Version 60


Advanced Microsoft Query and SQL examples<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Creating mail merge letters using stored procedures<br />

In <strong>the</strong> following example, letters are being prepared to mail to <strong>the</strong> parents of each future student who<br />

has an interview booked with <strong>the</strong> Head of Campus, using <strong>the</strong> crspFutureActivityPrint stored<br />

procedure. An activity has been created on <strong>the</strong> Activity tab of Future Student Maintenance. See<br />

Future Student Maintenance - Activity tab in <strong>the</strong> Future students manual.<br />

In <strong>the</strong> example, <strong>the</strong> interview is booked with Sarah Adamski's and her parents, as displayed on <strong>the</strong>:<br />

• Activity tab (selected above)<br />

• Modify Activity window (seen below).<br />

Activities are selected for <strong>the</strong> mail merge based on <strong>the</strong>ir Activity and <strong>the</strong> Mail Request field.<br />

However, if <strong>the</strong> Mailed Date and Mailed By fields are populated with values, this means that this<br />

activity has already has been printed.<br />

Version 60 Page 6-73


Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Advanced Microsoft Query and SQL examples<br />

The Activity field codes are maintained in <strong>the</strong> luFutureActivity lookup table. In this example,<br />

INTBOOK has been created for interviews that have been booked. See Maintaining lookup tables in<br />

<strong>the</strong> System maintenance manual.<br />

To create mail merge letters using a stored procedure, such as <strong>the</strong> crspFutureActivityPrint<br />

procedure:<br />

1. Open Microsoft Word.<br />

2. Select Tools > Letters and Mailings > Mail Merge (Microsoft Excel 2003).<br />

Step 1 of <strong>the</strong> Mail Merge tab is displayed on <strong>the</strong> document window.<br />

3. Select <strong>the</strong> type of document you are working on.<br />

Page 6-74 Version 60


Advanced Microsoft Query and SQL examples<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

4. Click Next: Starting document.<br />

Step 2 of <strong>the</strong> Mail Merge tab is displayed on <strong>the</strong> document window.<br />

5. Select <strong>the</strong> starting document.<br />

6. Click Next: Select recipients.<br />

Step 3 of <strong>the</strong> Mail Merge tab is displayed on <strong>the</strong> document window.<br />

Version 60 Page 6-75


Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Advanced Microsoft Query and SQL examples<br />

7. Click Browse.<br />

The Select Data Source window is displayed.<br />

8. Select Tools > MS Query.<br />

The Choose Data Source window is displayed.<br />

9. Select <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base you plan to use. That is:<br />

• SynergyOne for mostly non-financial <strong>data</strong><br />

• SynergyOneFinance for finance <strong>data</strong>.<br />

10. Clear <strong>the</strong> Use <strong>the</strong> Query Wizard to create/edit queries field.<br />

Page 6-76 Version 60


Advanced Microsoft Query and SQL examples<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

11. Click .<br />

The SQL Server Login window is displayed.<br />

12. Type in your username and password.<br />

Note: This is your usual <strong>Synergetic</strong> username and password.<br />

13. Click .<br />

The Add Tables window is displayed.<br />

14. Click .<br />

Version 60 Page 6-77


Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Advanced Microsoft Query and SQL examples<br />

15. Click .<br />

The SQL window is displayed.<br />

16. Type <strong>the</strong> stored procedure and its parameters. See Stored procedures (on page 72) for details of<br />

each procedure. In this example, type:<br />

• exec<br />

• <strong>the</strong> procedure name, crspFutureActivityPrint<br />

• <strong>the</strong> first parameter, @Activity='', where code is <strong>the</strong> activity code required<br />

• <strong>the</strong> second parameter, @Campus='


Advanced Microsoft Query and SQL examples<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

19. Select File > Return Data to Microsoft Word.<br />

The Mail Merge Recipients window is displayed.<br />

Note: Ensure that you return this <strong>data</strong> as soon as possible, as <strong>the</strong> <strong>data</strong> <strong>from</strong> Microsoft Query is<br />

not available for longer than 15 minutes.<br />

20. Click .<br />

Step 4 of <strong>the</strong> Mail Merge tab is displayed on <strong>the</strong> document window.<br />

Version 60 Page 6-79


Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Advanced Microsoft Query and SQL examples<br />

21. Click More Items.<br />

The Insert Merge Field window is displayed.<br />

22. Locate and select <strong>the</strong> field to insert into <strong>the</strong> document.<br />

23. Click .<br />

The field is inserted in <strong>the</strong> document.<br />

24. Repeat steps 22 and 23 until all of <strong>the</strong> required fields are added to <strong>the</strong> document.<br />

25. Close <strong>the</strong> Insert Merge Field window.<br />

26. Add o<strong>the</strong>r text and format <strong>the</strong> letter.<br />

Page 6-80 Version 60


Advanced Microsoft Query and SQL examples<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

27. Click to view <strong>the</strong> merged <strong>data</strong>.<br />

28. Format any <strong>data</strong>base fields, such as date fields with <strong>the</strong> time included.<br />

Tip: Right mouse and select Toggle Field Codes, to format <strong>the</strong> date, such as \@ "d/mm/yyyy".<br />

29. Preview <strong>the</strong> output and merge <strong>the</strong> letters.<br />

30. Save <strong>the</strong> document.<br />

This document can form <strong>the</strong> basis of o<strong>the</strong>r similar letters based on future student activities.<br />

Version 60 Page 6-81


Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Advanced Microsoft Query and SQL examples<br />

Printing mail merge letters using an existing document<br />

In <strong>the</strong> following example, letters are being prepared to mail to <strong>the</strong> parents of each future student who<br />

has an application with a certain status. A mail merge letter has already been created, using <strong>the</strong><br />

crspFutureStatusChangePrint stored procedure.<br />

An application has been entered for a future student on <strong>the</strong> Applications tab of <strong>the</strong> Future Student<br />

Maintenance window. See Future Student Maintenance - Applications tab in <strong>the</strong> Future students<br />

manual.<br />

In this example, <strong>the</strong> application's status can be:<br />

• viewed on <strong>the</strong> Applications tab (selected above)<br />

• viewed and updated on <strong>the</strong> Modify Future Student Application window (seen below).<br />

Applications are selected for <strong>the</strong> mail merge based on <strong>the</strong>ir Status.<br />

Page 6-82 Version 60


Advanced Microsoft Query and SQL examples<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

The values in <strong>the</strong> Status field on <strong>the</strong> Modify Future Student Application window are defined in <strong>the</strong><br />

luFutureStatus lookup table. See Maintaining lookup tables in <strong>the</strong> System maintenance manual.<br />

The selected value (Testing, in this example) is linked to <strong>the</strong> luFutureStatusMerge lookup table<br />

using its MergeCode of T. When a status is changed to Testing, its MergeCode is also changed as<br />

well. Any applications with this MergeCode are selected by <strong>the</strong> crspFutureStatusChangePrint<br />

stored procedure.<br />

To print mail merge letters using an existing document set up to use a stored procedure, such as <strong>the</strong><br />

crspFutureStatusChangePrint procedure:<br />

1. Start Microsoft Word.<br />

The Microsoft Office Word window is displayed.<br />

Note: See Stored procedures (on page 72) for details of each procedure.<br />

Version 60 Page 6-83


Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Advanced Microsoft Query and SQL examples<br />

2. Click .<br />

The Microsoft Word document is opened with <strong>the</strong> latest <strong>data</strong> using <strong>the</strong> stored procedure and its<br />

current parameters.<br />

3. Print <strong>the</strong> merged letters.<br />

4. Switch back to <strong>Synergetic</strong> to review <strong>the</strong> <strong>data</strong> changes that <strong>the</strong> procedure has made, if required.<br />

In this example, switch back to <strong>the</strong> History tab of <strong>the</strong> Future Student Maintenance window. See<br />

Future Student Maintenance - History tab in <strong>the</strong> Future students manual.<br />

Page 6-84 Version 60


Advanced Microsoft Query and SQL examples<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

5. Click .<br />

The <strong>data</strong> that was updated using Microsoft Word is refreshed on <strong>the</strong> History tab, as highlighted<br />

below.<br />

Version 60 Page 6-85


Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

Advanced Microsoft Query and SQL examples<br />

Reprinting mail merge letters<br />

If you need to reprint mail merge letters to certain community members, you first need to understand<br />

which:<br />

• stored procedure is being used<br />

• <strong>the</strong> relevant fields that are updated by <strong>the</strong> stored procedure.<br />

Details for each stored procedure are listed in <strong>the</strong> table covered earlier. See Stored procedures (on<br />

page 72).<br />

Tip: If <strong>the</strong> mail merge letter has not been updated since it was last used, you can just reprint <strong>the</strong><br />

single page <strong>from</strong> Microsoft Word.<br />

To reprint a letter created using a stored procedure, such as <strong>the</strong> crspEnquiryProspectusPrint<br />

procedure:<br />

1. Open <strong>the</strong> Enquiry tab of Enquiry Student Maintenance. See Enquiry Student Maintenance -<br />

Enquiry tab in <strong>the</strong> Future students manual.<br />

2. Locate <strong>the</strong> enquiring student.<br />

3. Clear <strong>the</strong> Prospectus Date.<br />

4. Click .<br />

Tip: If you have access to set fields in bulk, you can clear <strong>the</strong> fields for all of <strong>the</strong> selected records.<br />

See Setting field values in bulk in <strong>the</strong> Introduction manual.<br />

Page 6-86 Version 60


Advanced Microsoft Query and SQL examples<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong><br />

5. Open <strong>the</strong> letter in Microsoft Word, originally created using <strong>the</strong> crspEnquiryProspectusPrint<br />

procedure.<br />

The Microsoft Office Word window is displayed.<br />

Note: The campus parameter is not used in <strong>the</strong> example above.<br />

6. Click .<br />

The Microsoft Word document is opened with <strong>the</strong> latest <strong>data</strong> using <strong>the</strong> stored procedure.<br />

7. Print <strong>the</strong> merged letters.<br />

Version 60 Page 6-87


This page intentionally left blank


Index<br />

Index<br />

.<br />

.dqy • 40<br />

A<br />

AddressComma • 5<br />

AddressFull • 5<br />

Advanced Microsoft Query and SQL examples • 63<br />

C<br />

Common duplication problems • 38<br />

Creating mail merge letters using stored procedures • 73<br />

crspFutureActivityPrint • 73<br />

crspFutureStatusChangePrint • 82<br />

CurrentSemesterOnlyFlag • 5, 63<br />

D<br />

Data<br />

<strong>Extracting</strong> <strong>from</strong> <strong>Synergetic</strong> • 1<br />

Database<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> • 1<br />

<strong>Extracting</strong> <strong>data</strong> without query wizard • 46<br />

Fields • 1<br />

Views • 1<br />

DeceasedFlag • 5, 63<br />

Duplication problems • 38<br />

E<br />

Editing<br />

Microsoft Query • 35<br />

Editing a Microsoft Query using <strong>the</strong> wizard • 35<br />

Excel<br />

Using to extract <strong>data</strong> <strong>from</strong> <strong>Synergetic</strong> • 1<br />

<strong>Extracting</strong> <strong>data</strong><br />

Advanced SQL examples • 63<br />

Common duplication problems • 25<br />

Example • 51<br />

From <strong>Synergetic</strong> • 1<br />

Inserting existing SQL statement • 40<br />

Using stored procedures • 71, 72<br />

With query wizard • 25<br />

Without query wizard • 46<br />

<strong>Extracting</strong> <strong>data</strong> <strong>from</strong> <strong>the</strong> <strong>Synergetic</strong> <strong>data</strong>base • 1<br />

<strong>Extracting</strong> <strong>data</strong> using Microsoft Query directly • 46<br />

<strong>Extracting</strong> <strong>data</strong> using <strong>the</strong> Microsoft Query wizard • 25<br />

<strong>Extracting</strong> student name and contact details example • 51<br />

F<br />

Fields<br />

Database • 1<br />

FileSemester • 5, 63<br />

FileYear • 5, 63<br />

Finance views • 19<br />

I<br />

Inserting an existing SQL statement • 40<br />

M<br />

Mail merge<br />

Printing letters • 82<br />

Reprinting letters • 86<br />

Using stored procedures • 73<br />

MailName • 5<br />

MailSalutation • 5<br />

Main Finance views • 19<br />

Main <strong>Synergetic</strong> views • 7<br />

Microsoft Query • 63<br />

Advanced SQL examples • 63<br />

Common duplication problems • 25<br />

Editing • 35<br />

Emailing to CDA • 46<br />

<strong>Extracting</strong> <strong>data</strong> without <strong>the</strong> wizard • 46<br />

<strong>Extracting</strong> with query wizard • 25<br />

Inserting existing SQL statement • 40<br />

Problem with • 46<br />

Using to extract <strong>data</strong> • 46<br />

Wizard • 25<br />

P<br />

Printing mail merge letters using an existing document •<br />

82<br />

Problem<br />

Duplication • 38<br />

R<br />

Reprinting mail merge letters • 86<br />

S<br />

SQL<br />

Advanced examples • 63<br />

Using to extract <strong>data</strong> • 40<br />

SQL statement • 40<br />

Stored procedures • 71, 72<br />

StudentContactNormalMailFlag • 5, 63<br />

StudentContactType • 5, 63<br />

StudentStatus • 5, 63<br />

<strong>Synergetic</strong> views • 1, 5, 7<br />

T<br />

Tables<br />

Database • 1<br />

Joining • 5<br />

Linking • 5<br />

U<br />

Using stored procedures to retrieve <strong>Synergetic</strong> <strong>data</strong> • 71<br />

V<br />

ValidAddressFlag • 5, 63<br />

vAssetDepreciation • 19<br />

vAssets • 19<br />

vBankReconciliation • 19<br />

vCashReceiptsEntry • 19<br />

vCommunicationsCurrent • 7<br />

vCommunicationsPast • 7<br />

vCommunityAddresses • 7<br />

vCommunityAddressesConstit • 7<br />

Version 60 Page 6-89


Index<br />

vCreditorInvoiceEntry • 19<br />

vCreditorInvoices • 19<br />

vCreditors • 19<br />

vCreditorTransactions • 19<br />

vDebtorActiveArrangements • 19<br />

vDebtorInstalmentsStudents • 19<br />

vDebtors • 19<br />

vDebtorSiblingDiscounts • 19<br />

vDebtorStudentConcessions • 19<br />

vDebtorTransactionAddress • 19<br />

vDonorPledges • 7<br />

vDonorPledgesReceipts • 7<br />

vDonorProspectAddress • 7<br />

vDonorProspectHistoryAddress • 7<br />

vDonorReceipts • 7<br />

vEnquiryContactAddress • 7<br />

vEnrolmentDeposits • 19<br />

vEvents • 7<br />

vEventsCurrent • 7<br />

vEventsPast • 7<br />

vFinanceReport • 19<br />

vFutureContactAddress • 7<br />

vFutureStudents • 7<br />

vGeneralLedgerJnlBudgetTotal • 19<br />

vGLMonthlyMovementInColumns • 19<br />

vGLReportingMonthSummary • 19<br />

Views<br />

Database • 1, 5, 7<br />

Finance <strong>data</strong>base • 19<br />

Linking • 5<br />

vItemSales • 19<br />

vItemStock • 19<br />

vNZMoE_eAR_SchoolDetails • 7<br />

vNZMoE_StudentDataChanges • 7<br />

vPastStudentAddress • 7<br />

vPayrollEmployeePayDetails • 19<br />

vPayrollEmployeePayDetailTots • 19<br />

vPayrollEmployees • 19<br />

vPurchaseOrders • 19<br />

vStaff • 7<br />

vStaffTimetableFull • 7<br />

vStudentAbsenceEvents • 7<br />

vStudentAbsenceEventsAttendances • 7<br />

vStudentAbsences • 7<br />

vStudentAssessmentAreaSendMat • 7<br />

vStudentAssessmentAreasResults • 7<br />

vStudentClasses • 7<br />

vStudentContactAddress • 7<br />

vStudentContactAllAddress • 7<br />

vStudentContactsParentsDebtor • 7<br />

vStudentContactsRelationOnly • 7<br />

vStudentCourses • 7<br />

vStudentFormsAbsences • 7<br />

vStudentMedDetailsPrimContact • 7<br />

vStudentMedicalDetails • 7<br />

vStudentParentsMCEETYA • 7<br />

vStudentRelations • 7<br />

vStudentRelationsAll • 7<br />

vStudentReportsNoResults • 7<br />

vStudentReportsSemester • 7<br />

vStudentReportsSemesterResults • 7<br />

vStudentReportsSemesterYear • 7<br />

vStudents • 7<br />

vStudentsAll • 7<br />

vStudentsAndLOA • 7<br />

vStudentsContactsLivesWith • 7<br />

vStudentSubjectClass • 7<br />

vStudentTimetableFull • 7<br />

vStudentTutorsAbsences • 7<br />

vxeOliverBorrowingExport • 7<br />

W<br />

What's new to <strong>Extracting</strong> <strong>data</strong> • 2<br />

Word<br />

Using to extract <strong>data</strong> <strong>from</strong> <strong>Synergetic</strong> • 1<br />

Page 6-90 Version 60

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!