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

ARRAY refresh

Status
Not open for further replies.

LikeThisName

Vendor
May 16, 2002
288
US
using asp/sqlserver to generate a javascript flag and prevent duplicates or exceeding hundred percent, problem is correctling flaggin duplicate projections.

PROBLEM: IF array is empty instead of always being empty when it should be it is what ever it was last if not empty.

SO when it should return empty,15,empty,20 it returns: empty,15,15,20

here is my code:
Code:
if WorkPct <= pctAvailable Then
  strSQL3="SELECT WLoad FROM Table1 WHERE (Date1='" & ThisDate & "') AND (UserID = '" & session("UserID")& "') AND (JOB='"& ThisJOB & "');"
  set oRS = objConn.Execute(strSQL3, lngrecs, 1)
  checkJOB = oRS.GetRows

  if isEmpty(checkJOB) then
    set oRS = objConn.Execute(strSQL, lngrecs, 1)
  else
    Flag = 1
    AlertMsg = AlertMsg & ThisJOB & " Would Be a Duplicate for " & ThisDate & "\n"
  end if
Else
  Flag = 1
  AlertMsg = AlertMsg & cstr(WorkPct) & "% Would Exceed 100% for " & ThisDate & "\n"
end if

Thanks for shedding in any light,




LikeThisName <- ? Sorry It's Taken =)
 
BTW that code is in a loop and I added this line:
Code:
Erase CheckJOB
and while it now correctly returns empty,15,empty,20 the empty between 15 and 20 still gets flagged

LikeThisName <- ? Sorry It's Taken =)
 
problemed solved but not sure if best solution
i revamped so if statement reads like this now
Code:
if isEmpty(checkJOB) Or isNull(CheckCAM(0,0) then

LikeThisName <- ? Sorry It's Taken =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top