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
 SQL Server Development (2000)
 Another query

Author  Topic 

Rita Bhatnagar
Posting Yak Master

172 Posts

Posted - 2001-04-17 : 11:40:09
How can we do this in Stored Procedure?
.
.
.
.
Where......
AND
If adatePeriod <> 0 Then
lstrSQL = lstrSQL & " AND e.StartDateTime >= CvDate('" & Format(adatePeriod, "mm/01/yyyy") & "')"
lstrSQL = lstrSQL & " AND e.StartDateTime < CvDate('" & Format(DateAdd("m", 1, adatePeriod), "mm/01/yyyy") & "')"
End If

   

- Advertisement -