Results 1 to 2 of 2
  1. #1
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232

    help with SQL statement in a query

    Hi this is the SQL statement that I use in a query to generate a report, I need to only show "service call type" to be Seasonal only
    Thanks Angie

    TRANSFORM First([Service Calls].[Service Call Type]) AS [FirstOfService Call Type]


    SELECT [Service Calls].[Service Call Date]
    FROM [Service Calls] INNER JOIN Customers ON [Service Calls].CustomerID = Customers.CustomerID
    WHERE ((([Service Calls].[Service Call Technician])="AUSTIN" Or ([Service Calls].[Service Call Technician])="KYLE"))
    GROUP BY Customers.CustomerID, [Service Calls].[Service Call Date], [Service Calls].[Service Call Start Time], [Service Calls].Status, [Service Calls].CustomerID
    ORDER BY [Service Calls].[Service Call Date], [Service Calls].[Service Call Start Time]
    PIVOT [Service Calls].[Service Call Technician];

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Maybe
    Code:
    TRANSFORM First([Service Calls].[Service Call Type]) AS [FirstOfService Call Type]
    SELECT [Service Calls].[Service Call Date]
    FROM [Service Calls] INNER JOIN Customers ON [Service Calls].CustomerID = Customers.CustomerID
    WHERE (((([Service Calls].[Service Call Type]="Seasonal") AND [Service Calls].[Service Call Technician])="AUSTIN" Or ([Service Calls].[Service Call Technician])="KYLE"))
    GROUP BY Customers.CustomerID, [Service Calls].[Service Call Date], [Service Calls].[Service Call Start Time], [Service Calls].Status, [Service Calls].CustomerID
    ORDER BY [Service Calls].[Service Call Date], [Service Calls].[Service Call Start Time]
    PIVOT [Service Calls].[Service Call Technician];
    You can also apply a filter in report design or in code during the open event.
    Last edited by Micron; 10-16-2016 at 07:47 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. if statement in sql statement, query builder
    By 54.69.6d.20 in forum Access
    Replies: 4
    Last Post: 09-11-2012, 07:38 AM
  2. Replies: 3
    Last Post: 07-10-2012, 05:23 AM
  3. Iif Statement in query
    By evanhughes in forum Queries
    Replies: 1
    Last Post: 11-03-2011, 08:55 AM
  4. Query (if Statement I Think?)
    By Hello World in forum Queries
    Replies: 3
    Last Post: 10-13-2011, 09:25 AM
  5. query iif statement help
    By swat in forum Queries
    Replies: 4
    Last Post: 09-30-2011, 11:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums