Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to Filter SPT
Message
 
 
To
30/10/2008 20:26:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01358528
Message ID:
01358535
Views:
21
This message has been marked as the solution to the initial question of the thread.
>Here is my SPT
>
>testString = "Select webprddt6.resmngt3.recseq, task, hours2, SUM(ahours) As ah From webprddt6.resmngt2" +;
>" Join webprddt6.resmngt3 On webprddt6.resmngt3.projindex = webprddt6.resmngt2.recseq" +;
>" Join webprddt6.resmngt3b On webprddt6.resmngt3b.taskindex = webprddt6.resmngt3.recseq" +;
>" Where status = 1 And projected = 0 And deptno = '660' Group By webprddt6.resmngt3.recseq, task, hours2"
>
>Would like to show only records where ah is lesthan hours2.

You just need to add having clause at the end of your statement
text to lcText noshow
     Select webprddt6.resmngt3.recseq, task, hours2, SUM(ahours) As ah From webprddt6.resmngt2 ;
   Join webprddt6.resmngt3 On webprddt6.resmngt3.projindex = webprddt6.resmngt2.recseq ;
   Join webprddt6.resmngt3b On webprddt6.resmngt3b.taskindex = webprddt6.resmngt3.recseq ;
   Where status = 1 And projected = 0 And deptno = '660'  ;
   Group By webprddt6.resmngt3.recseq, task, hours2 ;
   having sum(aHours) <2
endtext
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform