Results 1 to 5 of 5
  1. #1
    adnancanada is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    122

    how to run query which has millions of records in POdetails.

    I am using access 2013 frontend and backend SQL server. I have below this query. I am running this query via pass through query in Access but because of millions of records it runs continuly or freez but dost not give me output.

    Is there any best way to run this query fast. I have vitrual tables. There is no index on it.

    What is the best procedre to run this query fast. Kindly help.


    SELECT PODETAIL.PODATE, PODETAIL.PONBR, PODETAIL.ITEM, PODETAIL.VDRNBR, PODETAIL.WERKS, PODETAIL.MENGE, PODETAIL.MEINS, PODETAIL.BPRME, PODETAIL.GEWEI, PODETAIL.VOLUM, PODETAIL.VOL, PODETAIL.LTSNR, POHEADER.VDRNBR FROM PODETAIL


    INNER JOIN POHEADER
    ON
    (PODETAIL.PONBR = POHEADER.PONBR)
    WHERE POHEADER.VDRNBR = '000250000' AND POHEADER.PODATE BETWEEN 20140101 AND 20151231

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I know you've cross posted this, but you realize you're pulling 2 years data? Presumably that's a lot of records to cross the network. What are you using this for?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    Quote Originally Posted by adnancanada View Post

    Is there any best way to run this query fast. I have vitrual tables. There is no index on it.

    Properly index it and SQL/Access will do just fine.

    Jeff

  4. #4
    adnancanada is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    122
    Quote Originally Posted by InsuranceGuy View Post
    Properly index it and SQL/Access will do just fine.

    Jeff
    I tried to create index but I got error message , kindly see error message. Please also note that POHeader and PODetail are virtual tables.
    error message:

    "Incorrect syntax error near the keyword "WITH", (#156) if this statement is common table experssion or xmlnamespace clause, the previous statement must be terminated with semicolon (#319)"

    select query is running fine before where clause.

    CREATE VIEW VWPODETAIL
    WITH SCHEMABINDING
    AS
    SELECT
    PODETAIL.PODATE, PODETAIL.PONBR, PODETAIL.ITEM, PODETAIL.VDRNBR, PODETAIL.WERKS, PODETAIL.MENGE, PODETAIL.MEINS, PODETAIL.BPRME, PODETAIL.GEWEI, PODETAIL.VOLUM, PODETAIL.VOL, PODETAIL.LTSNR, POHEADER.VDRNBR FROM DBO.PODETAIL
    INNER JOIN DBO.POHEADER
    ON
    (DBO,PODETAIL.PONBR = DBO.POHEADER.PONBR)
    WHERE DBO.POHEADER.VDRNBR = '000250000' AND DBO.POHEADER.PODATE BETWEEN 20140101 AND 20151231

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    I tried this simple one but got error msg.

    CREATE VIEW vwPOheader
    WITH SCHEMABINDING
    AS
    SELECT PO, PODATE, VDRNBR, TERM1, TERM2 FROM dbo.ETTO


    ERROR MESG:
    cannot schema bind with view 'vwPOheader', dbo.ETTO is not schema bound (#4513)

  5. #5
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    You will want to engage a forum focused on SQL Server or a proper DBA since the problem is not MS Access related.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-12-2015, 09:02 AM
  2. Replies: 9
    Last Post: 04-18-2014, 03:03 PM
  3. Replies: 4
    Last Post: 03-29-2014, 01:29 AM
  4. Replies: 1
    Last Post: 01-24-2013, 05:50 PM
  5. Replies: 4
    Last Post: 08-02-2012, 10:59 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