What I run into is "Syntax error converting datetime from character string." when I try to query the database with the value from a previous query. (My appologies for making this sound confusing)
For example, I query the database and return the results into a 2D array. I can display the results fine with "_ArrayDisplay". I then take the results from the query and using the next to last row from the results, get the value from the datetime column.
It is when I take the value in $tmpDate and attempt to search with it that I get the syntax error above.
$iRval = _SQL_GetTable2D(-1, "select * from dbo.AllpagesToday WHERE PageRecip = 'SERVER_OC1' OR PageRecip = 'SERVER_ONCALL' AND Date > '" & $tmpDate & "' ORDER BY Date;", $aData, $iRows, $iColumns)
I have also attempted to convert the date format from: 20120319090303 to 2012-03-19 09:03:03.000 to no avail.
My conversion pieced together from other posts:
When I search using the converted datetime, it is as if the query ignored the datetime value and returns all values of the 2D array.
$iRval = _SQL_GetTable2D(-1, "select * from dbo.AllpagesToday WHERE PageRecip = 'SERVER_OC1' OR PageRecip = 'SERVER_ONCALL' AND Date > '" & _convertToDateTime($tmpDate) & "' ORDER BY Date;", $aData, $iRows, $iColumns)
Any suggestions? If more information is needed, let me know.
Edited by gritts, 19 March 2012 - 05:43 PM.





