Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 insert multiple records based on date difference

Author  Topic 

akpaga
Constraint Violating Yak Guru

331 Posts

Posted - 2009-11-01 : 20:45:17
hi

i have a table called customers

it has fields called customer id identity,customer name,customerdate.

i want write a stored procedure
where when user enters datefrom and dateto

i want to insert records in the customer table in the following way
say if datefrom is 10/25/2009 and dateto is 10/28/2009

1 record -1,customername,10/25/2009
2 record-2,customername,10/26/2009
3 record-3,customername,10/27/2009
4 record-4,customername,10/28/2009

i.e 4 records since 10/25/2009 - 10/28/2009 is 4 days

how can i achieve this .

thanks in adavance....


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-11-01 : 20:52:27
make use of the F_TABLE_DATE


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -