Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Union All
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01638309
Message ID:
01638323
Vues:
49
Did not check the whole statement, but there is an extra semicolon in the last select statement, I removed it here:
text to lcSQL noshow

select acc_code,sum(dr_amount)as dramount,sum(cr_amount)as cramount
	from vouchers where acc_code=?m.cash_code1 and [date]<f_date1
        GROUP BY acc_code
	union all 
	select acc_code,sum(dr_amount)as dramount, sum(cr_amount)as cramount
	from cashsalp where acc_code=?m.cash_code1 and [date]<f_date1
        GROUP BY acc_code
	union all
	select acc_code,sum(dr_amount) as dramount, sum(cr_amount) as cramount
	from crsalp where acc_code=?m.cash_code1 and [date]<f_date1
        GROUP BY acc_code 
	union all
	select acc_code,sum(dr_amount)as dramount,sum(cr_amount)as cramount
	from cashprp where acc_code=?m.cash_code1 and [date]<f_date1
     GROUP BY acc_code
endtext
>If you're using SQL Server try
>
>text to lcSQL noshow
>
>select acc_code,sum(dr_amount)as dramount,sum(cr_amount)as cramount
>	from vouchers where acc_code=?m.cash_code1 and [date]<f_date1
>        GROUP BY acc_code
>	union all 
>	select acc_code,sum(dr_amount)as dramount, sum(cr_amount)as cramount
>	from cashsalp where acc_code=?m.cash_code1 and [date]<f_date1
>        GROUP BY acc_code
>	union all
>	select acc_code,sum(dr_amount) as dramount, sum(cr_amount) as cramount
>	from crsalp where acc_code=?m.cash_code1 and [date]<f_date1
>        GROUP BY acc_code 
>	union all
>	select acc_code,sum(dr_amount)as dramount,sum(cr_amount)as cramount;
>	from cashprp where acc_code=?m.cash_code1 and [date]<f_date1
>     GROUP BY acc_code
>endtext
>
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform