Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Newbie Question
Message
De
28/02/2006 16:23:55
 
 
À
28/02/2006 15:47:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Divers
Thread ID:
01100105
Message ID:
01100127
Vues:
12
>This can be done in a single command, more or less like this:


>select ItemName,;
> sum(iif(month(DateField) = 1, ValueField, $0)) as Jan,;
> sum(iif(month(DateField) = 2, ValueField, $0)) as Feb,;
> ...

Thanks Hilmar,

I'm using VFP to connect to an SQL database via ODBC so I can't use the IIF() because it's not understood by the ODBC connect. Ultimately, once I figure out how to write this SQL (that's compatible with MSQ 6.5), I then need to move it to Excel & MS Query to pull the data directly into the spreadsheet. The people that need this data don't have a copy of VFP and I don't want to get involved in creating and distributing EXE's.

Thanks,
Robert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform