Selasa, 26 Agustus 2014

RE: [MS_AccessPros] Crosstab Query

 

Youssef,
 
There is one instance where you don't always need to declare parameters. If you specify the column headings in your crosstab you can get by without the data type declarations however it is still a good idea to declare them.
 
For instance, this crosstab from Northwind data doesn't require parameters for the references to combo boxes on a form:
 
TRANSFORM Count(Orders.OrderID) AS CountOfOrderID
SELECT Employees.LastName
FROM Employees INNER JOIN Orders ON Employees.EmployeeID = Orders.EmployeeID
WHERE (((Orders.OrderDate) Between [Forms]![frmDateRangeSelect]![cboMinDate] And [Forms]![frmDateRangeSelect]![cboMaxDate]))
GROUP BY Employees.LastName
PIVOT Format([OrderDate],"ddd") In ("Sun","Mon","Tue","Wed","Thu","Fri","Sat");

Specifying the column headings allows you to create columns that might not appear in your data range as well as set the display order from left to right.
 
Duane Hookom, MVP
MS Access
 

From: John Viescas

Youssef-
 
When you put a Parameter in a query, you should always explicitly declare it with a PARAMETERS clause, but for most queries Access lets you get away without it.  In a Crosstab query, you *must* explicitly declare the parameter for it to work.

John Viescas, Author
On Aug 26, 2014, at 10:30 AM, youssef2309@gmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
I need to filter data from a big list and then use the result to build a crosstab query
 
is it possible as it seems that the crosstab query does not accept the criteria

thanks in advance
 

__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (8)

.

__,_._,___

Tidak ada komentar:

Posting Komentar