Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My SQL statement counts uploaded files for each record:

SQL
SELECT PurchaseOrder_PK , COUNT(*) count FROM  Mytable GROUP BY PurchaseOrder_PK 
Having
COUNT(*) > 1


what I need to do is show that count in parenthesis after Documentation(xx) so that it shows the count of uploaded documents for each record as each record can contain more than one uploaded documents.

How can I edit the hyperlink below to do that? using SQL server 2008 R2 server Database table

My classic asp code:
response.write "<TH align='center'><a href='https://servername/DatabaseName/FolderName/xxxx.aspx?RequestID=" & lv_xx_pk & "'><b>Documentation</b></a> </TH>"

What I have tried:

tried adding count after Documentation but didnt show the count.
Posted
Updated 3-May-16 14:18pm
v3
Comments
Sergey Alexandrovich Kryukov 3-May-16 19:22pm    
"Record count for each record" is 1. Am I missing anything? :-)
—SA
George Jonsson 3-May-16 20:20pm    
That's the tricky part with conditions. They don't always come true. :-)
Sergey Alexandrovich Kryukov 3-May-16 22:18pm    
:-)
—SA
ZurdoDev 4-May-16 8:05am    
This should be very easy. Just put it after Documentation. What's the problem?
Member 11829482 4-May-16 12:22pm    
I put it like this but getting internal error message. How can I adjust it?
response.write "<TH align='center'>Documentation slq=" SELECT PurchaseOrder_PK , COUNT(*) count FROM POuploads GROUP BY PurchaseOrder_PK Having COUNT(*) > 1 " </TH> "

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900