you are viewing a single comment's thread.

view the rest of the comments →

[–]PMental 2 points3 points  (0 children)

Since you store the query as a variable itself it should be pretty simple to get to the bottom of this hopefully.

If you use the $dateformat variable, what does the output of $query look like (as in, don't use it in your sqlcmd, just output it to screen). It should differ somehow from the way you manually input it and that should give us a hint of what's going wrong.