Results 1 to 5 of 5

Thread: [RESOLVED] Simple Account App Layout

  1. #1

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Resolved [RESOLVED] Simple Account App Layout

    I have a local SQL Server Compact 3.5 DB that will have 12 tables for the year payments and 12 for receipts.

    I have got it working with July's table and am not sure if i will have to maunally make another 23 tables or some how reuse it via code.

    Can anyone suggest how to save creating another 11 tables for payments and 12 for receipts?

    This database will also need to be copied for the next finacial year when it arrives so i am also trying to work out how to make it a template database and then reload next year as a new blank DB.

    thanks
    toe

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Simple Account App Layout

    You only need one table for the whole year. Whatever schema you have right now, simply add a Month column to it and then store a number from 1 to 12 in it to indicate which month of the year it relates to. If you want all of July's records then you simply filter by that column where the value is 7.

    Again, you don't need to copy anything for other years. You simply add a Year column to the table as well. If you want data from March 2010 then you filter where the Month is 3 and the Year is 2010.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: Simple Account App Layout

    hey jm,

    thanks for that.

    So based on what you say there appears there is no reason i cannot have ONE column with a date formatted as 12/12/2013 and filter from that?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Simple Account App Layout

    Absolutely. You can filter by a range of dates based on month or year.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Simple Account App Layout

    That's how most of us do it. It may seem easier to have things segmented out... until the first time you have to combine data from multiple months, or years even...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width