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.
| Author |
Topic |
|
DrkMaster
Starting Member
11 Posts |
Posted - 2004-05-04 : 19:39:23
|
| DECLARE @Now AS datetime, @Month AS datetimeEXECUTE SET @Now = GetDate()EXECUTE SET @Month = @Now + 30SELECT * from ContractWHERE (EndDate <= @Month AND EndDate > @Now)I can run the previous code from the SQL Server Query Analyzer without any problems and get the resuls quickly and efficiently. I have an Access Front End (Yes, I know it is not a great solution but this is just the first phase of the project and the next phase will include using a Visual Basic Front End) that lets the users interact with the SQL Server Database. I would like to store this code as some sort of query or procedure to be run when a user clicks on a certain button. I tried to create a Procedure or a function or even a view without any success. I know I am doing something wrong and going about this the wrong way. I would like someone's help in modifying this code so it would be able to run as a view or procedure. Thank you. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-05-04 : 19:49:22
|
CREATE PROC SomeProcASDECLARE @Now datetimeDECLARE @Month datetimeSET @Now = GetDate()SET @Month = @Now + 30SELECT * from ContractWHERE (EndDate <= @Month AND EndDate > @Now) Tara |
 |
|
|
DrkMaster
Starting Member
11 Posts |
Posted - 2004-05-05 : 16:24:32
|
| Thank you |
 |
|
|
|
|
|