Results 1 to 3 of 3
  1. #1
    gireesh is offline Novice
    Windows 10 Access 2007
    Join Date
    Jun 2016
    Posts
    2

    query issue : how to modify query and run in access db

    hi experts,



    i need to modify the query and run after modification, can some one help me regarding this.below is modify query, can some one help me what are the steps need to run the query.


    SELECT [EB PPF].[Seller Primary Organization Name], [EB PPF].[Channel Type], [EB PPF].[Fiscal Year], [EB PPF].[Fiscal Half], Right([Fiscal Half],2) AS [Half Nm], [EB PPF].[Fiscal Quarter], Right([Fiscal Quarter],2) AS [Quarter Nm], [EB PPF].[Revenue Stream], [EB PPF].[TXN Type], [EB PPF].[Calendar Month], [EB PPF].[Reporting Source Company Siebel Location ID], [EB PPF].[Reporting Source Company Siebel Row ID], [EB PPF].[Reporting Source Company Siebel Row Name], [EB PPF].[Seller Company Siebel Location ID], [EB PPF].[Seller Company Siebel Row Name], [EB PPF].[Seller HQ Siebel Location ID], [EB PPF].[Seller HQ Siebel Row Name], [EB PPF].[Seller Site Siebel Location ID], [EB PPF].[Seller Site Siebel Row Name], [EB PPF].[Seller City], [EB PPF].[Seller State], MIP_New.PANHP, MIP_New.[EG MEMBERSHIP], MIP_New.[SW MEMBERSHIP], [EB PPF].[Product Group], [EB PPF].[Product Sub Group], [EB PPF].[Product Category], EBDerivedCategories.[EG Derived Category], [EB PPF].[Product Line], [EB PPF].[Product Line Name], Sum([EB PPF].
    [List Price]) AS [SumOfList Price], Sum([EB PPF].[Net Price]) AS [SumOfNet Price1], Sum([EB PPF].[Total Qty]) AS [SumOfTotal Qty], [EB PPF].[Fiscal Month], "Trident" AS Source, IIf([seller Primary Organization Name]="HP US","US",IIf([seller Primary Organization Name]="HP Canada","CA","Unknown")) AS Country, Date() AS LOAD_DATE

    FROM (([EB PPF] INNER JOIN YearXref ON [EB PPF].[Fiscal Year] = YearXref.FiscalYear) LEFT JOIN MIP_New ON [EB PPF].[Seller Company Siebel Location ID] = MIP_New.[LOCATION ID]) INNER JOIN EBDerivedCategories ON [EB PPF].[Product Line] = EBDerivedCategories.[Product Line]
    WHERE (((YearXref.Report)="10498") AND ((YearXref.YearType)="CY"))
    GROUP BY [EB PPF].[Seller Primary Organization Name], [EB PPF].[Channel Type], [EB PPF].[Fiscal Year], [EB PPF].[Fiscal Half], Right([Fiscal Half],2), [EB PPF].[Fiscal Quarter], Right([Fiscal Quarter],2), [EB PPF].[Revenue Stream], [EB PPF].[TXN Type], [EB PPF].[Calendar Month], [EB PPF].[Reporting Source Company Siebel Location ID], [EB PPF].[Reporting Source Company Siebel Row ID], [EB PPF].[Reporting Source Company Siebel Row Name], [EB PPF].[Seller Company Siebel Location ID], [EB PPF].[Seller Company Siebel Row Name], [EB PPF].[Seller HQ Siebel Location ID], [EB PPF].[Seller HQ Siebel Row Name], [EB PPF].[Seller Site Siebel Location ID], [EB PPF].[Seller Site Siebel Row Name], [EB PPF].[Seller City], [EB PPF].[Seller State], MIP_New.PANHP, MIP_New.[EG MEMBERSHIP], MIP_New.[SW MEMBERSHIP], [EB PPF].[Product Group], [EB PPF].[Product Sub Group], [EB PPF].[Product Category], EBDerivedCategories.[EG Derived Category], [EB PPF].[Product Line], [EB PPF].[Product Line Name], [EB PPF].[Fiscal Month], IIf([seller Primary Organization Name]="HP US","US",IIf([seller Primary Organization Name]="HP Canada","CA","Unknown"))
    HAVING ((([EB PPF].[Seller Primary Organization Name])="HP US" Or ([EB PPF].[Seller Primary Organization Name])="HP Canada")
    AND (([EB PPF].[Channel Type])="Unknown") AND (([EB PPF].[TXN Type])="AS" or ([EB PPF].[TXN Type])="ARUBA" ) AND (([EB PPF].[Seller Company Siebel Location ID])<>"10018319"));

    Thanks in Advance,
    Giri

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    really don't understand the question.

    You have the sql, which presumably comes from the sql window of the query writer - so you would just run the query by selecting the run option in the ribbon (the big red !) or selecting the datasheet view from the button next to it.

    If you are trying to run it and get errors - what are the errors? full description of the error required, not a partial description

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    As Ajax said, you haven't said what the problem is or errors you are getting. I don't see anything obviously wrong with the syntax, but I do see cases in the WHERE and the HAVING where numeric values are enclosed in quotation marks. If the values in the tables are numeric and not text, the quotes should not be there.

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

Similar Threads

  1. How to modify query criteria for ranges?
    By cykchanaa in forum Queries
    Replies: 1
    Last Post: 08-06-2015, 09:03 PM
  2. Replies: 3
    Last Post: 04-18-2015, 12:01 PM
  3. Replies: 5
    Last Post: 09-17-2014, 07:28 PM
  4. Modify a query
    By saray in forum Queries
    Replies: 2
    Last Post: 06-08-2013, 02:05 PM
  5. Replies: 2
    Last Post: 02-20-2010, 01:11 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