GROUP BY and Database Results table?

A

Aliza

Hi.

Is there any way to do use a "GROUP BY" clause in a custom
query that will give me a table (ideally using the
Database Results Wizard) that looks like this:

HEADER FOR GROUP A (that does not repeat)
line 1 of data for Group A
line 2 of data for Group A
lind 3 of data for Group A

HEADER FOR GROUP B (that does not repeat)
line 1 of data for Group B
line 2 of data for Group B
line 3 of data for Group B

etc...

Ideally, I would love this all to be in a neat table (with
merged cells to create the header line or a plain line of
non-table text) but I am not picky at this point!

Any guidance would be appreciated.
Aliza
 
C

Chuck

In fp2003 the form results wizzard can do this. You just have to set it up.
When you get pass the data screen you will see a option that says more
options click that and you can set up your criteria.
 
M

MD WebsUnlimited.com

Hi Aliza,

It is not possible in the DRW to have it create a "Header". You can
accomplish it using ASP/X.
 
G

Guest

Mike, thanks for the reply.

Do you happen to know where I can find a sample of doing
this?

Thanks!
Aliza
 
D

David Berry

Here's one sample:

<%
strHeader = ""
Do While Not objRS.EOF
If strHeader <> Trim(objRS("HEADER_FIELD")) Then
strHeader = Trim(objRS("HEADER_FIELD"))
%>
<tr>
<td colspan="3"><%= strHeader %></td>
</tr>
<%End If%>
<tr>
<td><%= Trim(objRS("FIELD1")) %></td>
<td><%= Trim(objRS("FIELD2")) %></td>
<td><%= Trim(objRS("FIELD3")) %></td>
</tr>
<%
objRS.MoveNext
Loop
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top