Hi,
 
I have this Stored Procedure that basically relists an action when it is finished
 
1. UPDATE  thisTable
2. SET   startDate = DATEADD(minute, DATEDIFF(minute, startDate, expiryDate), GETDATE()),
3.    expiryDate = DATEADD(minute, DATEDIFF(minute, startDate, expiryDate), GETDATE())
4. WHERE  (pkAuctionID IN (' + @lstAuctionID + ')) '
 
The problem comes in on line 2 and 3, obviously when the Startdate (line 2) is updated with the new value then on line 3 there is no difference in time anymore. The only way I think I can overcome this issue is by using a CURSOR, but I would like to do it without a CURSOR if possible.
 
Example:
Before update
startDate                                expiryDate
23/03/2003 17:00 AM                23/03/2003 17:10 AM
After update
23/03/2003 17:10 AM                23/03/2003 17:10 AM
While the result I want is
23/03/2003 17:10 AM                23/03/2003 17:20 AM
 
Anyone?
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to