You have set nocount on but another thing that can cause
this error is if you are getting an ansi warning when this
runs. One guess would be that you may have nulls in the
datetimeofcall column. If you run the query in Query
Analyzer, you'd get the error:
Warning: Null value is eliminated by an aggregate or other
SET operation.
If that's the issue, you can use isnull to handle the null -
depending on your business rules, something like:
(select max(isnull(datetimeofcall, '1/1/1900')) from table1
where sendemail=0)
-Sue
On 27 Jul 2004 12:06:19 -0700, tran008@iwon.com (htran)
[quoted text, click to view] wrote:
>Hi all,
>I get an invalid pointer error when I run the DTS package exporting to
>text file. All the columns are mapped to destination properly. The
>following is what I have for
>
>thanks
>
>SET NOCOUNT ON
>declare @CallLastResult as datetime
>set @CallLastResult= (select max(datetimeofcall) from table1 where
>sendemail=0)
>
>select FirstName, LastName,Phonenum,Storename, storenumber,
>retail_email as Email, Comment, howfindout as FindOut
>from table1 where callresultcode=17 and sendemail=0 and
>cast(datetimeofcall as datetime)
><=cast(@CallLastResult as datetime)
>
>SET NOCOUNT OFF
Actually, I should have said ansi warnings, not ansi errors.
If you run the Query in Query Analyzer using the grid, check
the messages tab for the warnings.
-Sue
On 27 Jul 2004 12:06:19 -0700, tran008@iwon.com (htran)
[quoted text, click to view] wrote:
>Hi all,
>I get an invalid pointer error when I run the DTS package exporting to
>text file. All the columns are mapped to destination properly. The
>following is what I have for
>
>thanks
>
>SET NOCOUNT ON
>declare @CallLastResult as datetime
>set @CallLastResult= (select max(datetimeofcall) from table1 where
>sendemail=0)
>
>select FirstName, LastName,Phonenum,Storename, storenumber,
>retail_email as Email, Comment, howfindout as FindOut
>from table1 where callresultcode=17 and sendemail=0 and
>cast(datetimeofcall as datetime)
><=cast(@CallLastResult as datetime)
>
>SET NOCOUNT OFF
Don't see what you're looking for? Try a search.