Results 1 to 4 of 4
  1. #1
    saustin1967 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Oct 2012
    Posts
    3

    Query issue - Does not see dates with previous year.

    Stumped.
    I have an Access 2003 database with a query that will pull data from table for the current year just fine.


    When I try to query a previous year, i.e. any date in 2013, I get no records returned, just no data.
    There are records for these dates in the table, and if I set my computer date back to 12/31/13 I can pull all the records for that year.

    Only parameters on the query are the date
    >=[PDateS] and <=[Pdate2]

    What am I missing?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What are PDateS and PDate2? Are these popup inputs?

    Post the full SQL statement.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    saustin1967 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Oct 2012
    Posts
    3
    June7, I thnk you may have inadvertantly pointed me to the solution.
    I hate following someone elses work.
    When I pulled up the SQL for this query I found this:

    SELECT DISTINCTROW Month([prod_day]) AS FMonth, tbl_press_run.upd_time, tbl_press_run.prod_day, tbl_press_run.product_name, tbl_press_run.shift, tbl_press_run.press_run_min AS [RUN MINUTES], tbl_press_run.pressload_actual AS PL, [Pressload Product Input Factors].[Footage/Pressload] AS FT, [PL]*[FT] AS TOTAL, [Pressload Product Input Factors].[GOALS/HOUR], ([RUN MINUTES]/60*[GOALS/HOUR]) AS GOAL, [PL]/[Goal] AS [%Goal]
    FROM [Pressload Product Input Factors] INNER JOIN tbl_press_run ON [Pressload Product Input Factors].Size = tbl_press_run.product_name
    WHERE (((tbl_press_run.prod_day)>=[PDateS] And (tbl_press_run.prod_day)<=[PDate2]) AND ((Year([upd_time]))=Year(Now())));


    LOL, why would the previous admin include this
    Going to modify it and see if that resolves my issue, Thanks
    Will post results.


    Quote Originally Posted by June7 View Post
    What are PDateS and PDate2? Are these popup inputs?

    Post the full SQL statement.

  4. #4
    saustin1967 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Oct 2012
    Posts
    3
    That worked!

    Thanks for the assist.

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

Similar Threads

  1. Select Month from previous selected year
    By k0enf0rNL in forum Access
    Replies: 1
    Last Post: 01-15-2014, 12:14 PM
  2. Previous Year Data Query Expression
    By NotReese in forum Queries
    Replies: 4
    Last Post: 11-22-2013, 04:54 PM
  3. Dsum data between to dates for this year and last year
    By sdel_nevo in forum Programming
    Replies: 1
    Last Post: 06-13-2013, 06:48 AM
  4. Query Help - calculate variance previous year
    By brtucker in forum Queries
    Replies: 1
    Last Post: 01-31-2013, 05:40 PM
  5. Replies: 4
    Last Post: 01-10-2012, 06:26 PM

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