By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,362 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,362 IT Pros & Developers. It's quick & easy.

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

P: 1
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......
Mar 31 '08 #1
Share this Question
Share on Google+
3 Replies


ck9663
Expert 2.5K+
P: 2,878
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
Mar 31 '08 #2

P: 1
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
Jun 25 '08 #3

deepuv04
Expert 100+
P: 227
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

Expand|Select|Wrap|Line Numbers
  1. Select dateadd(day,number,'2008-06-15') 
  2. from master.dbo.spt_values 
  3. where master.dbo.spt_values.type='p' 
  4.       AND dateadd(day,number,'2008-06-15')<=('2008-06-25')
  5.  
thanks
Jun 25 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.