Results 1 to 3 of 3

Thread: how to list the date based on months?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Posts
    208

    how to list the date based on months?

    I am developing windows application using C# and MS sql.
    i have a table with records of startdate and enddate columns.
    example
    create table datetble(int did not null primarykey, startdate datetime, enddate datetime, cost int))
    then the values are
    101 1/1/2012 1/4/2012 1000
    now i want to show this on datagirdview like this.
    101 1/1/2012 30/1/2012 1000
    101 1/2/2012 30/2/2012 1000
    101 1/3/2012 31/3/2012 1000
    1010 1/4/2012 30/4/2012 1000

    just i need to show each months on datagirview. if there are 6 months.. then i want to show.. all the months in a table like above.
    help me please

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

    Re: how to list the date based on months?

    That's not really a great explanation. Examples help but only if we know the rules they're implementing. Are you saying that you have records that specify a date range that may span multiple months and, for each one, you want to produce multiple records with the date range adjusted to span no more than one calendar month?
    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
    Fanatic Member AceInfinity's Avatar
    Join Date
    May 2011
    Posts
    696

    Re: how to list the date based on months?

    As jmcilhinney had mentioned, the explanation here is vague and lacking good 'enough' detail for somebody to understand. Of course you can see what the issue is here You don't get any help when people don't understand what you're asking.

    ~Ace
    <<<------------
    Improving Managed Code Performance | .NET Application Performance
    < Please if this helped you out. Any kind of thanks is gladly appreciated >


    .NET Programming (2012 - 2018)
    ®Crestron - DMC-T Certified Programmer | Software Developer
    <<<------------

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