Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Assistance With A SQL Command
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00895537
Message ID:
00895541
Views:
16
Hi Kevin,

The EMPTY() function isn't Rushmore optimizable and I don't think you need NOT in WHERE clause.
SELECT BatchId, Id, EntryDate, TranDate, EntityId, Count(*) AS Cnt ;
  FROM Resh ;
  WHERE Resh.Status = SPACE(nn) ;
  GROUP BY BatchId, Id, EntryDate, TranDate, EntityId;
  ORDER BY Resh.BatchId ;
  INTO CURSOR Temp1
>I have a table where each record belongs to a batch.
>
>I need to pull a count of how many records are in each batch
>that have not had the status field set.
>
>I have:
>
>
>USE d:\projects\testdata\smts\resh.DBF
>
>SELECT BatchId, Id, EntryDate, TranDate, EntityId, Count(*) AS Cnt ;
>  FROM Resh ;
>  WHERE NOT EMPTY(Resh.Status ;
>  GROUP BY BatchId, Id, EntryDate, TranDate, EntityId;
>  ORDER BY Resh.BatchId ;
>  INTO CURSOR Temp1
>
>
>This does not correctly give back the counts, and its very slow.
>
>Anyone know how to do this?
>
>Thanks
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform