Results 1 to 4 of 4
  1. #1
    pher77 is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    2

    sales DB selecting column and column range

    I am creating a DB that contains sales data and is structured as such
    an_UPC_ID, str_UPC_Description, 1 week sales ending ######


    The one week slices of date start Feb 1, 2009 and continue till the end of 2012.
    Is there a way to create a query that will select the last column that is NOT NULL?
    I am also trying to find a way to create a range of 13, 26 and 52 weeks from the most current which would be the last column with a NOT Null results.
    Or should I structure my table differently?

    Any help and suggestions are much appreciated

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Your data is not normalized, and will likely be a nightmare to work with. I would expect fields like

    an_UPC_ID
    str_UPC_Description

    SalesDate
    Amount

    A UPC with 10 weeks of data would have 10 records in this table. When you got the 11th week's data, you'd add a record with that date. From there, it would be fairly easy to query the data for the ranges you describe. More on normalization here:

    Fundamentals of Relational Database Design -- r937.com
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pher77 is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    2
    Paul,
    my upc list is already at 6500 skus and will continue to grow. I already hold 125 weeks of sales with another 75 or so to go. will laying a new table out this way become an issue? i import 13 weeks of data at a time

    thank you for your help

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I don't think that's an unmanageable amount of data for Access. I'd certainly try it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 03-14-2011, 10:04 AM
  2. Query for date range from two column?
    By sunny in forum Queries
    Replies: 2
    Last Post: 07-28-2010, 07:12 AM
  3. Replies: 7
    Last Post: 04-27-2010, 02:47 PM
  4. Replies: 1
    Last Post: 04-15-2010, 02:07 AM
  5. inserting values in column based another column
    By wasim_sono in forum Database Design
    Replies: 1
    Last Post: 06-27-2006, 05:23 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