Article ID: 147731
Article Last Modified on 8/20/1999
?SQLEXEC('SELECT {fn MONTH(date)} FROM sales WHERE {fn MONTH(date)}=9')
This SQL statement will return only the month value of the date field where
the month is September. A more realistic SQL statement would be:
?SQLEXEC('SELECT * FROM sales WHERE {fn MONTH(date)}=?cMonth')
nHandle = SQLCONNECT('DataSourceName','sa','')
cSQL = "SELECT {fn MONTH(date)} FROM sales WHERE {fn MONTH(date)}=9"
result = SQLEXEC(nHandle, cSQL)
This SQL statement will return only the month value of the date field where
the month is September. A more realistic SQL statement would be:
cSQL= 'SELECT * FROM sales WHERE {fn MONTH(date)}=?cMonth'
result = SQLEXEC(nHandle, cSQL)
The ODBC driver will see '{fn MONTH(data)}' as an ODBC function to be
passed to the SQL Server. You can use scalar functions on the columns of
the result set or the columns that restrict rows of a result set.
Additional query words: VFoxWin
Keywords: KB147731