Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Assistance With A SQL Command
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00895537
Message ID:
00895630
Vues:
14
When I was running this under VFP7, it worked fine.But with VFP8, you must
include all fields in the group by clause.

In VFP7, my SQL was:
SELECT EntryDate, TranDate, Resh.BatchId AS Batch, EntityId, Count(*) AS Cnt ;
  FROM Resh ;
  WHERE Resh.Status == " " ;
  GROUP BY BatchId ;
  ORDER BY Resh.BatchId ;
  INTO CURSOR Temp1
Which gave me back 138 records that looked like:
ENTRYDATE  TRANDATE   BATCH     ENTITYID CNT
----------------------------------------------------------
05/01/2003 04/30/2003 736246123 LIVE     8
05/01/2003 04/30/2003 736246443 CCTL     3
05/01/2003 04/30/2003 736247659 WEST     78
05/01/2003 04/30/2003 736248873 HARP     65
05/01/2003 04/30/2003 736249973 HARP     12
.
.
.
This data set represents the total number of records in each batch
that do not have the status set.


In VFP 8, when I added all the fields in the field list to the GROUP BY
clauses, I get 65765 records that look like:
ENTRYDATE  TRANDATE   BATCH ENTITYID  CNT
----------------------------------------------------------
05/01/2003 04/30/2003  736247659 WEST 1
05/01/2003 04/30/2003  736247659 WEST 1
05/01/2003 04/30/2003  736247659 WEST 1
05/01/2003 04/30/2003  736247659 WEST 1
05/01/2003 04/30/2003  736247659 WEST 1
05/01/2003 04/30/2003  736247659 WEST 1
05/01/2003 04/30/2003  736247659 WEST 1
05/01/2003 04/30/2003  736247659 WEST 1
.
.
.
Notice, that they are now no longer grouped by batch.

Im open to suggestions.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform