Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Newbie Question
Message
De
28/02/2006 16:26:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
28/02/2006 16:23:55
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:
01100130
Vues:
13
>>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

Sorry, I don't know how to do this in SQL Server. I am sure you can use the same basic principle, but the functions, of course, are different.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform