navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

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

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

 

Crosstab partly sorted

 
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 >> Crosstab partly sorted
Page: [1]
 
CraigBFG

 

Posts: 211
Joined: 7/25/2003
From: UK
Status: offline

 
Crosstab partly sorted - 7/23/2004 10:59:03   
Ok, my crosstab issue is partly sorted, where by I've got the DRW to generate the layout, and then I'm messing with the code after.

Problem
If I run my query to show records in a certain year, the crosstab will only generate columns for the months it has records for. So then when the page is generated, I get an error as certain month fields don't exist.

What I therefore need to do is either get the crosstab to generate all 12 monthly fields regardless of data, or put a few if/then/else's in the handle missing fields.

Help with either method would be most welcome.

My current SQL is :

TRANSFORM round(100/Count([tblJobs.DefId])*Sum(Right(DateDiff('d',[Timestamp],[DateClosed])-(DateDiff('ww',[Timestamp],[DateClosed])*2)<=[tbldefstd].[defstd],1)),1) AS OnTime
SELECT tblUsers.OrgName
FROM tblUsers INNER JOIN (tblDefStd INNER JOIN ((tblDefCatType INNER JOIN tblDefect ON tblDefCatType.DCTId = tblDefect.DCTId) INNER JOIN tblJobs ON tblDefect.DefID = tblJobs.DefId) ON tblDefStd.DefStdId = tblDefCatType.DefStdId) ON tblUsers.UId = tblJobs.UId
WHERE (((DatePart('yyyy',[Timestamp]))=2004))
GROUP BY tblUsers.OrgName
PIVOT DatePart('m',[Timestamp]);
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Crosstab partly sorted
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