Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why The Group Clause Doesn't Function
Message
 
 
À
26/03/2001 03:34:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00488500
Message ID:
00488617
Vues:
9
>I've set up a SQL in this way(shows like bellow), But the Group Clause doesn't work to the second field(expense.expense_type). I've test several times, but it still doesn't work. Pls give me a hand. Thanks!:)
>SQL STATEMENT:
select Expense.Employee_Expense_ID AS Expense_ID,Employee_Name,0.00 AS Deposit_Amount,Expense.Expense_Type AS Expense_Type,Expense.Expense_Date,SUM(Medic_Amount) AS Medic_Amount,0.00 AS Expense_Amount,0.00 AS Self_Paid,ExpenseBill.Expense_Type AS BillType,SUM(Bill_Pages) AS Bill_Pages,Bill_Date,COUNT(*) as cntExp ;
>From Expense,ExpenseBill,EmployeeBaseINFO ;
>Where Expense.Unique_ID=ExpenseBill.Unique_ID And EmployeeBaseINFO.Employee_Expense_ID=Expense.Employee_Expense_ID And between(Expense.Expense_Date,{^2001-03-21},{^2001-03-26});
>Order By Expense_ID, Expense_Date, Expense_Type, BillType, Bill_Date ;
>Group By Expense_ID, Expense_Type
IOW, you have to use the same names, as you have as AS clause. You also can use
order by 1,4 ;
group by 1,4
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform