Forums
This topic is locked
Showing Unique Field in Table????
17 Jul 2001 21:47:10 Ray Mr. posted:
I am trying to figure how to show this unique field in a table in UD4.My SQL statement is as follows:
SELECT DISTINCT date, Call_group, FROM dbo.CallGrpSumChrgsCustomer
WHERE Invoice_date = 'MMColParam2' AND Cust_no = 'MMColParam' GROUP
BY DATE, Call_Group
ORDER BY DATE
What is happening is that the query results show 7/17/01 & 6/22/01
date is repeating...with each call group
DATE Call_Group
--------------- -----------
7/17/01 A
7/17/01 B
7/17/01 C
7/17/01 D
9/30/00 1
6/22/01 1
6/22/01 2
12/02/00 3
I WANT to show just the 1st Unique date with its call groups...
then the proceeding dates. Can I do this in a table in UD4?
DATE Call_Group
------------ -------------
7/17/01 A
B
C
D
9/30/00 1
6/22/01 1
2
12/02/00 3
Any suggestions or help would be appreciated.
Replies
Replied 17 Jul 2001 23:27:04
17 Jul 2001 23:27:04 Joel Martinez replied:
that's a toughy... but it can be done... what you have there can be done with some sort of conditional statement...
first, find the repeat region (or if you coded it yourself, the do while not rs.eof), for the purposes of this, I'll use a very simple table:
<pre id=code><font face=courier size=2 id=code>
<table>
<%
dim thedate
thedate = ""
<b>DO WHILE NOT rs.eof</b>
IF thedate <> rs.fields("date".value then
%>
<tr><td><%=rs.fields("date".value %></td><td></td></tr>
<%END IF%>
<tr><td></td><td><%=rs.fields("Call_group".value %></td></tr>
<%
thedate = rs.fields("date".value
rs.movenext
<b>LOOP</b>
%>
</table></font id=code></pre id=code>
I believe that should do the trick, you may have to debug it a bit (the forum doesn't have that good of a debugger <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
Joel Martinez
----------
Is this thing on?....
Edited by - joelmartinez on 07/17/2001 23:28:34
first, find the repeat region (or if you coded it yourself, the do while not rs.eof), for the purposes of this, I'll use a very simple table:
<pre id=code><font face=courier size=2 id=code>
<table>
<%
dim thedate
thedate = ""
<b>DO WHILE NOT rs.eof</b>
IF thedate <> rs.fields("date".value then
%>
<tr><td><%=rs.fields("date".value %></td><td></td></tr>
<%END IF%>
<tr><td></td><td><%=rs.fields("Call_group".value %></td></tr>
<%
thedate = rs.fields("date".value
rs.movenext
<b>LOOP</b>
%>
</table></font id=code></pre id=code>
I believe that should do the trick, you may have to debug it a bit (the forum doesn't have that good of a debugger <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
Joel Martinez
----------
Is this thing on?....
Edited by - joelmartinez on 07/17/2001 23:28:34
Replied 17 Jul 2001 23:43:39
17 Jul 2001 23:43:39 Ray Mr. replied:
Thanks Joel!