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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set Month no = Current Month in DTS

Status
Not open for further replies.
Dec 28, 2004
87
US
I have table called AllCustInfo on DB2 which i am importing to sql server using transform data task.

while i import the data using transform data task i have used following query.

(Query : Get all customer for current month & Year )

SELECT CUST_LIFE_NO, ACCTG_WEEK_NO, ACCTG_MONTH_NO, ACCTG_YEAR_NO
FROM DB024142.BIWK_SALSUMTB
WHERE ACCTG_MONTH_NO = ? AND ACCTG_YEAR_NO = ?
using Visual Basic Activex Script

I have defined global varieble called

ACCTG_MONTH_NO = cureent month
ACCTG_YEAR_NO = current year

My Questing is now how do i pass these value to my query ?
Right now i have error "Wrong Number of Parameters"

Any help would really appriciate...
 
Code:
declare @ACCTG_MONTH_NO int --needs to be relevant data type
declare @ACCTG_YEAR_NO int --needs to be relevant data type
set @ACCTG_MONTH_NO = 1
set @ACCTG_YEAR_NO = 2005
SELECT CUST_LIFE_NO, ACCTG_WEEK_NO, ACCTG_MONTH_NO, ACCTG_YEAR_NO
FROM DB024142.BIWK_SALSUMTB
WHERE ACCTG_MONTH_NO = @ACCTG_MONTH_NO AND ACCTG_YEAR_NO = @ACCTG_YEAR_NO

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top