I'm new to DTS and not sure of the best way to tackle this one.
I am attempting to import data into SQL2000 from an archaeic flat file database on UNIX.
The import will run each night and needs to pick out unallocated records and records allocated in the last 14 days.
I created a DTS package based on an SQL atatement
My problem is that the source database doesn't have the functionality to calculate the date 14 days.
How do I calculate the date using SQL server and pass this to my SQL statement.
I know I could use VBScript to create my connections and generate the SQL, but are there any simpler ways available to me.
Thanks in advance
Gary Parker
MIS Data Analyst
Manchester, England
I am attempting to import data into SQL2000 from an archaeic flat file database on UNIX.
The import will run each night and needs to pick out unallocated records and records allocated in the last 14 days.
I created a DTS package based on an SQL atatement
Code:
SELECT ACCNT_CODE AS AccountCode, D_C AS DebitOrCredit, TRANS_DATE, ALLOC_DATE, DUE_DATE, AMOUNT, TREFERENCE, ALLOCATION
FROM SALFLDG
WHERE (TRANS_DATE <= { fn CURDATE() }) AND (TRANS_DATE >= { d '2003-01-01' }) AND (ALLOC_DATE IS NULL OR ALLOC_DATE >= 'date 14 days ago'
My problem is that the source database doesn't have the functionality to calculate the date 14 days.
How do I calculate the date using SQL server and pass this to my SQL statement.
I know I could use VBScript to create my connections and generate the SQL, but are there any simpler ways available to me.
Thanks in advance
Gary Parker
MIS Data Analyst
Manchester, England