Need to insert the dates between the start date and end date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rubansigamani
    New Member
    • Mar 2008
    • 1

    Need to insert the dates between the start date and end date

    Start date: 03-04-2007
    End date: 08-04-2007

    I need the get the dates bound between the start date and the end date.
    Also i need to insert those dates into a table in a single query.

    Could you help me out soon......
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by rubansigamani
    Start date: 03-04-2007
    End date: 08-04-2007

    I need the get the dates bound between the start date and the end date.
    Also i need to insert those dates into a table in a single query.

    Could you help me out soon......
    Lots of ways. What's your tables structure? Do you need this in a stored proc or there's a front-end apps that handles the two dates?


    -- CK

    Comment

    • sarinmonu
      New Member
      • Jun 2008
      • 1

      #3
      Originally posted by ck9663
      Lots of ways. What's your tables structure? Do you need this in a stored proc or there's a front-end apps that handles the two dates?

      -- CK

      Hi can you please send me a script for this

      my requirement is , i need to generate dates between two dates and store in a table, eaxmple i take the current date as end date and a date which is six month old, it needs to insert all dates inbetween it

      my table is

      CREATE TABLE emp_attendence (
      attend_date datetime default '00-00-0000',
      PRIMARY KEY (attend_date)
      ) TYPE=MyISAM;

      can you mail me the script to mailsarin@yahoo .com

      thanks in advance

      Comment

      • deepuv04
        Recognized Expert New Member
        • Nov 2007
        • 227

        #4
        Originally posted by sarinmonu
        Hi can you please send me a script for this

        my requirement is , i need to generate dates between two dates and store in a table, eaxmple i take the current date as end date and a date which is six month old, it needs to insert all dates inbetween it

        my table is

        CREATE TABLE emp_attendence (
        attend_date datetime default '00-00-0000',
        PRIMARY KEY (attend_date)
        ) TYPE=MyISAM;

        can you mail me the script to mailsarin@yahoo .com

        thanks in advance
        Hi,

        here is the query to get dates between startdate and enddate

        [code=sql]
        Select dateadd(day,num ber,'2008-06-15')
        from master.dbo.spt_ values
        where master.dbo.spt_ values.type='p'
        AND dateadd(day,num ber,'2008-06-15')<=('2008-06-25')
        [/code]

        thanks

        Comment

        Working...