Hi,
If anybody is interested I decided to do it inside the stored procedure. And scheduling the DTS package to run on the first day of every month.
I am setting EndDate to getdate() and startdate to
dateadd(mm,-1,@getdate()).
I guess this will work for me,
thanks,
Shal
...DTS Package which executes a stored procedure and exports the result to an Excel file.
In the stored procedure I use two dates like:
Select * from Table1 where
ScanDate betweeen @StartDate and @EndDate.
Now I want to schedule the DTS Package so that it runs once every month, and in the...
...@StartDate)) = 2
THEN @StartDate
WHEN datepart(dw, convert(datetime, @StartDate)) between 3 and 5
THEN DateAdd(dd, -1*(datepart(dw, convert(datetime, @StartDate))-2), @StartDate)
WHEN datepart(dw, convert(datetime, @StartDate)) between 6 and 7
THEN DateAdd(dd, 9 -...
I was able to achieve this from the report by using:
grouping similar to:
=WeekDayName(weekday('mydate'))
This was in reporting services and this can be done in crystal reports also I guess.
Thanks,
Shal.
...@StartDate)) = 2
THEN @StartDate
WHEN datepart(dw, convert(datetime, @StartDate)) between 3 and 5
THEN DateAdd(dd, -1*(datepart(dw, convert(datetime, @StartDate))-2), @StartDate)
WHEN datepart(dw, convert(datetime, @StartDate)) between 6 and 7
THEN DateAdd(dd, 9 -...
I have a stored procedure.
It takes two parameters @StartDate and @EndDate. When any date range is entered, @startdate always selects the closest monday and @enddate always selects the closest sunday(some one helped me out). It works fine as I did this for weekly results. Now they want to enter...
Hi All,
If I have two dates in a stored procedure, like
@StartDate and @EndDate, if the user puts in any dates for these two parameters, how can I round it to the nearest monday.
Let's say
user inputs:
@StartDate = '06/04/2004' and @EndDate = '06/12/2004'
I want @StartDate ='06/07/2004' and...
I am a bit confused now, I was thinking, we will do dutydraw back for each month, let's say for Jan 2004, I get all the barcodes we have exported. Then run the report only once for january. At that time, the stored procedure will use up whatever information we have in the import table JKMT...
...short, yes you are absolutely correct that is what I want to do. Now in the report for dutydraw back for the second export the value should be (25*1.3012+ 5*1.2825)
Karl,
We will have all the information we need about the import in the JKMT table. And we only export after they have been...
Hi all,
Thank you for all the replies.
Tektipdejango you have clearly expressed what I am trying to do exactly. Is it possible ? If yes how?
Along with updating the JKMT table I want the duty paid amount in the barcode export table, for the report. Now let's say I had a third export of the...
Hi,
We have two tables, Trandetail (td) which has all the barcodes and styles we export. From this I get the quantity we export for a date range. We have another table JKMT which has all the information about all the barcodes and styles we have imported.
In my stored procedure, to create a...
...as Lodgement,
JKMT.Tariff as Tariff,
JKMT.Barcode as Barcode
From
JK_Mondiale_Tariff JKMT
Where JKMT.QuantityRemaining IS NOT NULL
) ddb
where #DutyDrawBack.Barcode = ddb.Barcode
SELECT *
FROM
#DutyDrawback
ORDER BY Style,Barcode
DROP TABLE #DutyDrawback
GO
Thank...
I think I came across this problem, but my table was empty to start with, and I was getting the same error. What I did was, add a test row (just one) to the table. Then the DTS import worked fine.
Hope this helps,
Shal
Hello Karl,
The error message is " must declare variable @summary" and it is not giving the error line, but my guess is the SET of the update statement or the where clause of the update statment.
In the code below :
I changed the:
------------------------------------------
SET @summary.qty =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.