Results 1 to 4 of 4
  1. #1
    alblonde89 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    2

    Rolling over database to next year

    Hello!

    I am trying to correct a problem I ran into last year. I work off of a database that was built by someone else so I have found lots of "Easter Eggs" over the last year and I'm not the most proficient Access user on the planet.
    Last year, my database would not "roll over" to 2015 and display any reports for the week of December 29-January 2. It worked fine the following week. I think the issue is probably within the DatePart function, but I'm not 100% sure.
    I use the database for scheduling and for this week's and next week's schedules, I am showing a week number of 51 and 52, respectively. Is there a way to increase the week number to 53, or do I need to rewrite the coding to begin the year on the week with January 4 as being the first "week of the year?" I believe there are ways to do both, but I honestly don't know how to fit them into my current coding.

    I am not by any means great at any of this, so an elementary response would be very much appreciated!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    The only way to answer your question regarding how to fix it, one would have to understand how the reporting is accomplished and the structure of the tables/data. To answer your question regarding rewriting the coding, it seems almost certain you will have to rewrite some code. Also, how the data is stored may be part of the issue.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    DatePart("ww", #12/29/2014#)

    returns 53.

    DatePart("ww", #1/2/2015#)

    returns 1.

    So as ItsMe said, we would need to know a lot more about your db structure and report design and exactly how the 'week number' is calculated. If you want a week to include days from different years (a 'crossover' week), this will not be accomplished with the DatePart function. One approach is to calculate the first date of the week that a given date falls into and use that 'first day of week' as the grouping criteria.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  4. #4
    alblonde89 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    2
    Thank you both so much for your quick replies. I will attach it as soon as possible this evening as I cannot do that at my current workstation. Looking forward to the assistance!

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

Similar Threads

  1. Replies: 1
    Last Post: 12-15-2015, 12:55 PM
  2. Replies: 3
    Last Post: 06-22-2015, 06:36 AM
  3. Replies: 2
    Last Post: 04-29-2014, 03:04 AM
  4. Replies: 7
    Last Post: 11-11-2013, 08:54 AM
  5. Replies: 4
    Last Post: 01-09-2013, 11:16 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