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 2000 Forums
 Transact-SQL (2000)
 Loop for Date

Author  Topic 

prompratan
Starting Member

30 Posts

Posted - 2005-10-17 : 01:04:00
I want sql language for insert date to database.
example
1/1/2005 to 30/5/2005
I don't have idea.

T_T

Thank you for all answer.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-17 : 01:13:15
Why do you need this?

Declare @t table(d dateTime)
Declare @d datetime
set @d='20050101'

While DateDiff(day,@d,'20050530')>=0
Begin
Insert into @t values(@d)
set @d=@d+1
End
select * from @t


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

prompratan
Starting Member

30 Posts

Posted - 2005-10-17 : 02:49:01
I want loop data for report. thank you madhivanan.
Go to Top of Page
   

- Advertisement -