I am running a mysql query that pulls down dates and department. I would like to output this into a excel file how ever I can't seem to get each rows to separate. I would like to have Departments in one row and Dates in another row. Thanks in advance.
Example of output: 04/26/201404/26/201404/26/201404/26/201404/26/201404/26/201404/26/201404/26/201404/26/2014
Func ComputerModel()
$SQLInstance5 = _MySQLConnect($UserName, $Password, $Database, $MySQLServerName)
$Model = ""
$Model2 = ""
$NametoFind3 = GUICtrlRead($Userid) ;This pulls from the gui
$RemoteFormatString4 = "SELECT * FROM accountinfo WHERE fields_15 BETWEEN '04/26/2014' AND '04/31/2014';"
$SQLCode5 = StringFormat($RemoteFormatString4, $NametoFind3)
$TableContents5 = _Query($SQLInstance5, $SQLCode5)
With $TableContents5
While Not .EOF
$Model &= .Fields("fields_15").value
$Model2 &= .Fields("Department").value
.MoveNext
WEnd
EndWith
;Write Excel
Local $oExcel = _ExcelBookNew()
Local $aArray[5][2] = [[$Model, 1],[$Model2, 2],["big_daddy", 3],["DaleHolm", 4],["GaryFrost", 5]] ;0-Base Array
_ExcelWriteSheetFromArray($oExcel, $aArray, 1, 1, 0, 0) ;0-Base Array parameters
_MySQLEnd($SQLInstance5)
EndFunc ;==>ComputerModel