Solved

cross tab in vb.net on an access database

Posted on 2013-11-21
1
675 Views
Last Modified: 2013-12-10
I want to obtain a cross tab in vb.net on an access database.

I have got this from the internet

I don't understand how it woks.

Help

TRANSFORM Sum(IIf([FieldName]="Qty",[Quantity],[Quantity]*[Order Details]![UnitPrice])) AS TheValue
 SELECT Products.ProductName
 FROM tblXtabColumns, Products INNER JOIN (Orders INNER JOIN [Order Details]
 ON Orders.OrderID = [Order Details].OrderID) ON Products.ProductID = [Order Details].ProductID
 WHERE (Orders.OrderDate Between #1/1/1998# And #3/31/1998#)
 GROUP BY Products.ProductName
 PIVOT [FieldName] & Month([OrderDate]);
0
Comment
Question by:Anthony Matovu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39667200
Transform creates a crosstab query, but it's difficult to understand the syntax (at least for me). If you have a copy of Access, then you can create a new query and switch to SQL view, and then copy/paste that into the query window. Assuming your table structure matches what the query expects, you'll be able to work with the query to get things right.

Transform article on MSDN:
http://msdn.microsoft.com/en-us/library/office/bb208956%28v=office.12%29.aspx
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question