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 |
surfingdanno
Starting Member
2 Posts |
Posted - 2005-07-12 : 06:00:04
|
Hi i Am having difficulty with this code, can anyone help.I get the error: ADO Error: Line 5: Incorrect Syntax near '!'around this area of the code:set @mydate = forms!test!field0 How can I say : date - variable, use varible date then run the report?any help would be appreciated.(code fields have been modified as it is sensitive data)Alter Procedure [temp1]Asdeclare @mydate dateset @mydate = forms!test!field0 --date field in test formTruncate Table temp1Insert Into Temp1Select date1from table1Where date1 > @mydate |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-07-12 : 06:30:47
|
I think you need to pass that date as parameter to the procedureAlter Procedure [temp1](@date datetime)AsTruncate Table temp1Insert Into Temp1 Select date1 from table1 Where date1 > @date MadhivananFailing to plan is Planning to fail |
 |
|
surfingdanno
Starting Member
2 Posts |
Posted - 2005-07-12 : 07:21:17
|
Cheers for that. The code worked fine.One other question. At present the value is entered via a Parameter box. Do you know how to substitute this so I can enter the value into a text box on a form? |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-07-12 : 07:43:22
|
Call this procedure by passing textbox value to itSomething likecon.execute("temp1 #" & textbox.text & "#")MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|