thepip3r:
There are some concepts which you have to be familiared with to understands how to manipulate an array.
Refer to the manual for Dynamic Program Variables.

First:
We Get rid of "$datediff = $UnixDate - $UnixMonth" cause we have to make it work AND then do any calculation.

Second:
"? $retcode" Is NOT gonna return anything cause it is an array and not a string, you are treating it as a variable and not an array.

Kixtart can support multi dimension array (up to 60) that is you think of an Excel sheet every new dimension you have just think it of a new column, so....
In your case you have a 1 demension array result of the fact that you do 'SELECT compid FROM' = single column.
If you where to deal with multidimensional your select should be FE 'SELECT compid, Ip, OS FROM' wich is not the case.

"Ubound($retcode)" is gonna tell you a number (total ammount of rows) wich is the ammount of times that 'For' is gonna Loop or walk the array, like this '$test = $retcode[$x]' in wich $x will increase up to $CountArray by one.
I havent seen any count() function you just get it from the ubound().


Code:

$sql = "SELECT compid FROM computers WHERE Name='$HostName' AND MACAddress='$MAC'"
$retcode = DBGetRecordSet($objConn,$sql)

$CountArray=Ubound($retcode) ;top value number of array rows.
For $i=0 to $CountArray
$row = $retcode[$x]
? "Row="+$row
? "Counter="+$x
Next



Sure there is a more specific terminology but I tried to be understandable on the first place.

Give a shout in case you are stucked.
_________________________
Life is fine.