Re: asp/sql looping problem



Thanks Daniel.

Really appreciate it and your hint made my day.
It all worked with Pivot tables and was after all so easy to print out.



Daniel Crichton wrote:
bbinto wrote on 17 Jan 2007 08:13:10 -0800:

i am new to asp/sql and of course, i have some problems with it.

please let me explain:
i have a problem with a sql result and its output in asp

my sql result table looks like this

there are 3 fix payment options I want to show always: Visa, Mastercard
and AMEX.

I would like to output this result table shown before as followed in
asp:

First sorted by city, then date, and then always followed by 3 fixed
columns for the payment types

City1 Visa Mastercard Amex
-------------------------------------------------------------------
1/1/2007 123.32 23.30 40.30
1/2/2007 - 12.30 234.20



I tried it with looping while checking if date and city changed.
however, every time i try it, i can't show it properly like the way i
want it.

Please, can somebody help?

If you need more information, please let me know.
thank you so much.


Look up "pivot" for the database system you are using, and it should give
you a start. What you want is a pivot table based on city+date, with payment
type as the column, and then you should find your loop much easier to
program.

Dan

.



Relevant Pages

  • Re: how to pass form results
    ... Server side processing (ASP) does not support Access Pivot table views or data pages from Access ...
    (microsoft.public.frontpage.programming)
  • Issue with ASP and Win XP
    ... We are using Microsoft Office Web Components 11.0 in our asp page to use ... Pivot Table component. ... It is running well on all OS except Windows XP. ...
    (microsoft.public.inetserver.asp.general)
  • how to free one column
    ... I have created a pivot table using ASP and HTML language. ... there any possibility to freeze first three columns which are static, ... because the whole report takes a lot of space and I have to scroll right to ...
    (microsoft.public.scripting.vbscript)
  • Re: asp/sql looping problem
    ... It all worked with Pivot tables and was after all so easy to print out. ... i have a problem with a sql result and its output in asp ... columns for the payment types ... City1 Visa Mastercard Amex ...
    (microsoft.public.inetserver.asp.db)