David Higgs
Programmer
The following Code Queries my MySQL database for Contacts made on 29/04/2019
I would like to replace '2019-04-18' with a “variable” so that the MySQL will return a list of Contacts made on the day of querying the Database. To replace '2019-04-18' I used the following Code:
which returns ‘todays date’ in the following format 2019-04-18
The above code produces an “Alias 'cTempLogbook' is not found” error, presumably due to a failed connection.
I have tried numerous options to no avail. Any help would be much appreciated.
Regards,
David.
Recreational user of VFP.
Code:
log_option = "left(Time_on,10) = '2019-04-18' "
MyLog_Selection = "SELECT * FROM &TBL_Logbook where " + log_option
SQLEXEC(SQLCONN,MyLog_Selection ,'cTempLogbook')
I would like to replace '2019-04-18' with a “variable” so that the MySQL will return a list of Contacts made on the day of querying the Database. To replace '2019-04-18' I used the following Code:
Code:
LEFT(TTOC(DateTime(),3),10)
which returns ‘todays date’ in the following format 2019-04-18
Code:
MyLog_Selection = "SELECT * FROM &TBL_Logbook where Left(Time_on,10) = (LEFT(TTOC(DateTime(),3),10)) "
SQLEXEC(SQLCONN,MyLog_Selection ,'cTempLogbook')
The above code produces an “Alias 'cTempLogbook' is not found” error, presumably due to a failed connection.
I have tried numerous options to no avail. Any help would be much appreciated.
Regards,
David.
Recreational user of VFP.