Hi
Reading the messages of the several forum on VFP, I have inasmuch as the totality of the Select-sql is written using DATE() and DATETIME() directly.
But DATE() to DATETIME() are estimated only once, to the beginning of the query, or for every evaluation made in the query ?
On MSQL, GETDATE() is evaluate only at begin, and is costant within the query.
Example:
SELECT ..GETDATE()... FROM ... GETDATE() ....
is equal to
DECLARE @now DATETIME
SET @now = GETDATE()
SELECT .. @now ... FROM ... @now ....
On VFP, DATE() and DATETIME() is eval for every evaluation in the query.
It slows down the query execution, but can build wrong result.
Example:
CREATE CURSOR pivot (id I AUTOINCR )
FOR i=1 TO 1000000
APPEND BLANK
NEXT
SELECT id,DATETIME() FROM pivot
is not equal to
m.now = DATETIME()
SELECT id,m.now FROM pivot
I think:
we are fortunate:
- little customers work to midnight;
- a lot often the query comes executed in little second ones.
Comment.
Fabio