| Author |
Topic  |
|
cincyKid
Starting Member
22 Posts |
Posted - 05/05/2012 : 18:01:18
|
| no, LISTID is primary key for the LIST table. I just need that primary key select to be worked in to my query without having to add it to the GROUP BY. I dont see how an aggregate will work since i need the exact ID, not min, max, sum, count, etc. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47023 Posts |
Posted - 05/05/2012 : 18:08:30
|
as told before you cant select LISTID directly so far as you're grouping on Employee
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
cincyKid
Starting Member
22 Posts |
Posted - 05/05/2012 : 18:51:01
|
| so how do i get it in there to use it? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47023 Posts |
Posted - 05/05/2012 : 18:59:14
|
quote: Originally posted by cincyKid
so how do i get it in there to use it?
I cant understand what meaning does it make to show LISTID against data aggregated to employee level Post some sample data and show what should be your output. unless you do that I cant make out why exactly you're doing this. Make sure you include all fields you want in output along with LISTID
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
cincyKid
Starting Member
22 Posts |
Posted - 05/05/2012 : 19:25:32
|
ok lets try it:
Data Output:
Employee Name (EMPLDesc) Total Companies (BLXF.BLXFBSNSID) Earliest Date of activity (MinDate) Latest Date of activity (MaxDate) The List ID (LISTID)
so if you picture a table with columns and rows, each row will have the above information. The LISTID will come in play in my link. So something like:
<a href="details.asp?listID=<%=RS("LISTID")%>"><%=RS("MinDate")%></a>
Make sense? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47023 Posts |
|
|
cincyKid
Starting Member
22 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47023 Posts |
Posted - 09/27/2012 : 12:02:34
|
just try this and see if it gives correct values
SUM(CASE WHEN ad_info.approv = 1 THEN 1 END) / COUNT(ad_info.inv_number)) * 100.0
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
cincyKid
Starting Member
22 Posts |
Posted - 09/27/2012 : 12:10:09
|
thanks visakh, someone answered in the other thread and I have it working, just trying to fine tune the number of digits and round it up, etc.
thank you! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47023 Posts |
Posted - 09/27/2012 : 12:31:15
|
welcome
the reason was implicit conversion!
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
Topic  |
|