Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Access (https://www.askmehelpdesk.com/forumdisplay.php?f=441)
-   -   Crosstab Query in MS Access (https://www.askmehelpdesk.com/showthread.php?t=34456)

  • Sep 18, 2006, 01:22 AM
    sukkarfarid
    Crosstab Query in MS Access
    How can I change the my query to crosstab query..
    please see the picture..

    http://www.l22l.com/l22l-up-1/8a7081adec.jpg

    I write this code... how can I change to a crosstab query

    SELECT SeaTable.location, Count(SeaTable.location) AS CountOflocation
    FROM SSFMainTable INNER JOIN SeaTable ON SSFMainTable.ID = SeaTable.MainTLink
    WHERE (((SSFMainTable.AD) Between [enter1] And [enter]))
    GROUP BY SeaTable.location
    HAVING (((SeaTable.location) Like "G/A*" Or (SeaTable.location) Like "Qiz*"));

    Thanks and regards
    Farid
  • Sep 18, 2006, 06:07 AM
    ScottGem
    A crosstab query requires THREE columns in the source. One column for the Rows, one for the columns and one for calculation. So you have to add a column to your query. I would add a column like so:

    Counts: " "

    Use the Crosstab Wizard and make that column your ROW, make the Location column your Columns and then count the primary key field for your counts.

  • All times are GMT -7. The time now is 08:04 PM.