a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Format Change

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Format Change
Page: [1]
 
accessman

 

Posts: 74
Joined: 9/13/2005
Status: offline

 
Format Change - 9/14/2005 19:41:59   
Hi Everybody:
For example:
Qry 1:
[Vendor Name] [date1] [paid1] [date2] [paid2] [date3] [paid3]
Micro_________1/2/05__$1
Micro_________2/1/05__$2
Micro______________________3/1/05_$3
Micro___________________________________4/1/05_$4
Micro______________________5/1/05_$5

How can I change to this format in the Report:
[Vendor Name] [date1] [paid1] [date2] [paid2] [date3] [paid3]
Micro_________1/2/05__$1____3/1/05_$3____4/1/05_$4
Micro_________2/1/05__$2____5/1/05_$5

I want to save the space. This way only shows 2 rows. So, Could you help me to solve this problem? Thanks a lot. Thanks.


bobby

 

Posts: 11399
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: Format Change - 9/14/2005 20:19:18   
I can't think of a clean and easy way...

loop through each Vendor and build each row with a multi-dimensional array based on the vendor...?

I guess it depends on what kind of report.

Are we talking about an ASP page or a MS-Access generated Report based on a Query?

The change would have to come after the query has been made. You query all the data and then have to sort through some loops to display every date and paid amount per vendor and then move onto the next vendor... looping through all the vendors.

Seems like the long way around to me, but I personally haven't tried it out yet... :)





_____________________________

In order to remove a wall you must first remove the Windows®


:)

(in reply to accessman)
rubyaim

 

Posts: 757
Joined: 6/22/2005
Status: offline

 
RE: Format Change - 9/14/2005 20:45:11   
Edit: Bobby obviously types waayyyy faster tha I can :)

=====
Anyway, FWIW, if this is in Access:

Wild guess without knowing how your DB is set-up:

Create 3 separate queries.

Vendor1-Query. [Vendor] [Date 1] [Paid 1]
Vendor2-Query. [Vendor] [Date 2] [Paid 2]
Vendor3-Query. [Vendor] [Date 3] [Paid 3]

And the 4th to bring it together (query the other queries)

Select all fields from Vendor1, Date2 and Paid 2 from Vendor2 and Date3 and Paid 3 from Vendor3.

For something like this the join properties between Vendor1 an Vendor2 would be option 3 - include all from Vendor1 and only those in Vendor2 where the joined fields are equal, and the join between Vendor1 and Vendor3 would be option 2 - include all from Vendor1 and only those from Vendor3 where they are equal.

SQL would be something like:


SELECT Vendor1.Vendor AS Vendor1_Vendor, Vendor1.Date1 AS Vendor1_Date1, Vendor1.Paid1 AS Vendor1_ Paid1, Vendor2.Date2 AS Vendor2_ Date2, Vendor2.Paid2 AS Vendor2_ Paid2, Vendor3.Date3 AS Vendor3_Date3, Vendor3.Paid3 AS Vendor3_ Paid3
FROM (Vendor2 RIGHT JOIN Vendor1 ON Vendor2.Vendor = Vendor1.Vendor) LEFT JOIN Vendor3 ON Vendor1.Vendor = Vendor3.Vendor;





_____________________________

Sally

(in reply to accessman)
accessman

 

Posts: 74
Joined: 9/13/2005
Status: offline

 
RE: Format Change - 9/15/2005 2:33:40   
No. It will shows duplicate value.

(in reply to accessman)
accessman

 

Posts: 74
Joined: 9/13/2005
Status: offline

 
RE: Format Change - 9/15/2005 12:00:57   
Do you have any method ? Thanks.

(in reply to accessman)
dzirkelb1

 

Posts: 1324
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Format Change - 9/15/2005 12:25:45   
Loop is the way to go...something like this:

<%
DIM connReport
DIM sqlReport
DIM rsReport

myDSN ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("/Database.mdb")
set connReport=server.createobject("adodb.connection")
connReport.open myDSN

sqlReport = "your query here"
set rsReport=connReport.execute(sqlReport)
IF rsReport.eof THEN
response.write("Problem with "&sqlReport)
ELSE
arrayReport=rsReport.getrows

for r=0 to ubound(arrayReport,2)
response.write("<table border=0 cellpadding=0 cellspacing=0>")
response.write("<tr>")
response.write("<td>"&arrayReport(0,r)&"</td>")
response.write("<td>"&arrayReport(1,r)&"</td>")
response.write("<td>"&arrayReport(2,r)&"</td>")
response.write("<td>"&arrayReport(3,r)&"</td>")
response.write("<td>"&arrayReport(4,r)&"</td>")
response.write("<td>"&arrayReport(5,r)&"</td>")
response.write("<td>"&arrayReport(6,r)&"</td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td colspan=3>Micro_________1/2/05__$1</td>")
response.write("<td colspan=3>_________3/1/05__$3</td>")
response.write("<td>_____4/1/05__$4</td>")
response.write("</tr>")
response.write("<tr>")
response.write("<td colspan=3>Micro_________2/1/05__$2</td>")
response.write("<td colspan=3>_________5/1/05__$5</td>")
response.write("</tr>")
response.write("</table")
response.write("<br><br>")
next
%>

(in reply to accessman)
dzirkelb1

 

Posts: 1324
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Format Change - 9/15/2005 12:34:40   
If this is just to display on a report in Access, then just use the automated report wizard in a columnar fashion, go into design view once done, and move stuff around until you see it how you like.

(in reply to accessman)
accessman

 

Posts: 74
Joined: 9/13/2005
Status: offline

 
RE: Format Change - 9/15/2005 13:43:04   
No. It doesn't work. It still show same format.

(in reply to dzirkelb1)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> Format Change
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts