Hi all,
The 'SEARCH' functionality doesn't seem to be working on the site so if my question has already been asked, apologies!
I have a table that has a number of date fields names 'EL1A', 'EL2A' and so on up to EL46A. I have fetched the row back via a cursor and am now attempting to perform a WHILE loop to go through each of the fields and select the earliest date from all the record date fields. Any ideas?
Cheers,
Sean
DECLARE @iCounter INT,
@ErrorCode INT,
@StartDate SMALLDATETIME
WHILE (@iCounter <= 46) AND
(@ErrorCode = 0)
BEGIN
SET @StartDate = /**move the value of the ELnA field in here using the @iCounter value**/
CONTINUE
/*Some other processing......*/
END
The 'SEARCH' functionality doesn't seem to be working on the site so if my question has already been asked, apologies!
I have a table that has a number of date fields names 'EL1A', 'EL2A' and so on up to EL46A. I have fetched the row back via a cursor and am now attempting to perform a WHILE loop to go through each of the fields and select the earliest date from all the record date fields. Any ideas?
Cheers,
Sean
DECLARE @iCounter INT,
@ErrorCode INT,
@StartDate SMALLDATETIME
WHILE (@iCounter <= 46) AND
(@ErrorCode = 0)
BEGIN
SET @StartDate = /**move the value of the ELnA field in here using the @iCounter value**/
CONTINUE
/*Some other processing......*/
END