02.06.2013 Views

Users Guide Visual FoxPro®" di Microsoft

Users Guide Visual FoxPro®" di Microsoft

Users Guide Visual FoxPro®" di Microsoft

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.

Per aggiungere l’importanza <strong>di</strong> un or<strong>di</strong>namento in base ai campi. Utilizzare il tasto a sinistra del campo e trascinatelo<br />

nella posizione desiderata nella finestra Ordering criteria.<br />

Potete or<strong>di</strong>nare i dati in or<strong>di</strong>ne ascendente e <strong>di</strong>scendente impostando il tasto nell’area opzioni or<strong>di</strong>namento ( Order<br />

option ). Ogni campo or<strong>di</strong>namento appare nella finestra Output Field nella scheda Filter con una freccia rivolta verso<br />

l’alto o verso il basso che in<strong>di</strong>ca se l’or<strong>di</strong>namento deve essere fatto in senso ascendente o <strong>di</strong>scendente.<br />

Raggruppare il risultato <strong>di</strong> una query<br />

Il raggruppamento fonde o raccoglie record simili in un record in modo da consentire calcoli basati su gruppi <strong>di</strong> record.<br />

Ad esempio, potreste voler trovare la somma <strong>di</strong> tutti gli <strong>di</strong> una regione specifica. Al posto <strong>di</strong> controllare tutti i records<br />

singolarmente, potete raggruppare tutti i records <strong>di</strong> una stessa regione in un solo record, e ottenere la somma <strong>di</strong> tutti gli<br />

or<strong>di</strong>ni <strong>di</strong> quella regione.<br />

Per controllare il modo con cui i records vengono raggruppati, utilizzate la scheda Grup By Query Designer.<br />

To control how records are grouped, use the Group By tab in the Query Designer. Il raggruppamento è molto più utile<br />

quando viene utilizzata in unione con la funzione <strong>di</strong> somma come SUM, COUNT, AVG e così via.<br />

Ad esempio, supponiamo <strong>di</strong> volere il totale degli importi <strong>di</strong> ogni co<strong>di</strong>ce cliente nella tabella clienti. Avete bisogno <strong>di</strong><br />

raggruppare tutti i records degli or<strong>di</strong>ni per ogni co<strong>di</strong>ce cliente in un solo record, e quin<strong>di</strong> trovare la somma totale degli<br />

or<strong>di</strong>ni.<br />

Prima <strong>di</strong> tutto dovete usare la scheda Fields per aggiungere l’espressione SUM(Or<strong>di</strong>ni.or<strong>di</strong>ne_netto) al risultato della<br />

query, quin<strong>di</strong> raggruppate i risultati in base al co<strong>di</strong>ce cliente. Il risultato mostra il totale netto degli or<strong>di</strong>ni <strong>di</strong> ogni<br />

cliente.<br />

Impostare le opzioni <strong>di</strong> Group By

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!