Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS error - Invalid Pointer?

Status
Not open for further replies.

ChuckLKing

IS-IT--Management
Jun 25, 2003
1
US

I have a SQL script I have tested in SQL Analyzer successfully but it fails in a data transformation task with an error of invalid pointer. This process evaluates the day of the week and depending on the results set the date in the format CCYYMMDD (20030707). The script follows:

--------------------------------------------------
-- EVALUATE DAY OF WEEK AND SET DATE AS (CCYYMMDD)
USE GLTRANS
DECLARE @DW CHAR(1)
DECLARE @DT CHAR(8)
SET @DW = CAST(datepart(Dw,GETDATE()) as CHAR(1))
--PRINT @DW
IF @DW = '2'
BEGIN
SET @DT = CONVERT(CHAR(50), GETDATE(), 112)-3
END
ELSE
IF @DW = '1'
BEGIN
SET @DT = CONVERT(CHAR(50), GETDATE(), 112)-2
END
ELSE
BEGIN
SET @DT = CONVERT(CHAR(50), GETDATE(), 112)-1
END

SELECT Corporation, Account, Center, [Guarantor number],
[Patient number], [Transaction ID], [Service date], [Posting date],
[Batch number], [AGC code],
[Procedure code],
[Transaction type], Physician, Department, [Financial class],
Location, Amount, Creation_Date
FROM GLTRANS
WHERE (Physician = '0000000') and Creation_Date = @DT
ORDER BY Center
------------------------------------------------------
Any ideas?

Thanks,
Chuck
cking@cntllp.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top