Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 22nd, 2004, 06:12 AM
Registered User
Join Date: Nov 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crosstab query with no results

Hi All,

This forum did solve 50% of my problem; hopefully I can solve the rest with your help.

I created a crosstab query that counts the number of records, and distribute the results, based on a time stamp, over the 4 quarters. When there is now result for i.e. Q2, the Nz function display's a "0". Perfect so far..!

But... when there are no results at all, the result of the crosstab query is completely empty. I want four "0"'s in that case.

Please advice! This is my code:

TRANSFORM Nz(Count(Q_LicensesSeatsLargeAccounts.Quantity),0) AS CountOfQuantity
SELECT Q_LicensesSeatsLargeAccounts.Reseller
FROM Q_LicensesSeatsLargeAccounts
WHERE ((Q_LicensesSeatsLargeAccounts.Reseller)=[Forms]![F_RBSC_Selection]![cboReseller])
GROUP BY Q_LicensesSeatsLargeAccounts.Reseller, Q_LicensesSeatsLargeAccounts.Reseller
PIVOT "Q" & DatePart("q",[OrderDate]) In ("Q1","Q2","Q3","Q4");

With regards,

Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit Query Results in Results Grid druid2112 SQL Server 2005 1 June 28th, 2007 08:49 AM
Display Crosstab Query Results - HELP? timmaher Classic ASP Databases 0 August 25th, 2005 09:47 AM
Crosstab Query Ben Access 7 November 22nd, 2004 06:08 AM
Crosstab query Berni016x SQL Server 2000 2 September 17th, 2004 10:43 AM
Crosstab query vladimir Access 1 December 1st, 2003 04:02 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.