Viewing 15 posts - 16,951 through 16,965 (of 18,923 total)
remove , DateCol and ,@DateCol
You know how to do an insert statement right??
June 10, 2005 at 12:57 pm
hmm not exactly,
(assuming you're gonna create a stored proc to do the insert) :
Insert into dbo.YourTable (Col1, Col2, DateCol, DateBefore, DateAfter) values (@Col1, @Col2, DateCol, dateadd(m, -6, Datefield), dateadd(m,...
June 10, 2005 at 12:49 pm
See my other answer in the other thread.
I've given you what I found... But I don't see how this can be done in vba. I suspect it can be...
June 10, 2005 at 12:46 pm
Yup, there it is :
DECLARE @Temp TABLE
(RowId int NOT NULL IDENTITY(1, 1),
Col1 varchar(20) NULL,
PRIMARY KEY...
June 10, 2005 at 12:44 pm
earlier : dateadd(m, -6, DateField)
later : dateadd(m, 6, DateField)
June 10, 2005 at 12:36 pm
I'd just copy the statement, or make it into a view and use it in both sps.... there's just no need for a temp table in this case, the statement...
June 10, 2005 at 12:32 pm
the where seems to force and index seek (removing a scan.. which is probabely the longest operation of the query).
However I can't really be sure without the relative cost to...
June 10, 2005 at 12:31 pm
Just don't start another one
.
June 10, 2005 at 12:28 pm
Why can't you use a select to do this already?
June 10, 2005 at 12:28 pm
It doesn't guarantee that you will catch all the databases in use.
June 10, 2005 at 12:28 pm
That doesn't work very well.
I can't find a way to capture the err message..
Maybe this will get you started (you'll need to translate to vba) :
Sub test()
On Error GoTo...
June 10, 2005 at 12:25 pm
it would surely help if I gave you this :
CREATE PROCEDURE [dbo].[SPNTest]
AS
SET NOCOUNT ON
Select Id, Name from dbo.SysObjects order by Name
Print 'Hello World'
RAISERROR (1, 0, 0)
SET NOCOUNT OFF
GO
June 10, 2005 at 12:25 pm
Viewing 15 posts - 16,951 through 16,965 (of 18,923 total)