OK i run into a bit of problem with VFP 7 and this strict date format and my ERP software Database.
I connect to the ERP software database which sends the date fields in the Year-Month-Date format and the cursor stores it in that format. Now when I try to do a select on the Cursor like so
SELECT * from ack WHERE entry_system_date >= {11/01/2001} AND entry_system_date <= {11/30/2001}
i get ambiguous Date Error message telling me to use {^2001-11-01} format Year-Month-Day. if i do that, it works.
I'm not against doing that way but how do i convert a TextBox with a date value into that format without doing this
ldFrom = "{^"+ STR(YEAR(goDates.txtFromDate.Value),4)+"-"+ RIGHT('00'+ALLTRIM(STR(MONTH(goDates.txtFromDate.Value))),2) +"-"+ RIGHT("00"+ALLTRIM(STR(DAY(goDates.txtFromDate.Value))),2) + "}"
ldTo = "{^" + STR(YEAR(goDates.txtToDATE.Value),4)+"-"+ RIGHT('00'+ALLTRIM(STR(MONTH(goDates.txttoDate.Value))),2) +"-"+ RIGHT("00"+ALLTRIM(STR(DAY(goDates.txttoDate.Value))),2) + "}"
BTW i did turn off Strict Date but to no avail
I connect to the ERP software database which sends the date fields in the Year-Month-Date format and the cursor stores it in that format. Now when I try to do a select on the Cursor like so
SELECT * from ack WHERE entry_system_date >= {11/01/2001} AND entry_system_date <= {11/30/2001}
i get ambiguous Date Error message telling me to use {^2001-11-01} format Year-Month-Day. if i do that, it works.
I'm not against doing that way but how do i convert a TextBox with a date value into that format without doing this
ldFrom = "{^"+ STR(YEAR(goDates.txtFromDate.Value),4)+"-"+ RIGHT('00'+ALLTRIM(STR(MONTH(goDates.txtFromDate.Value))),2) +"-"+ RIGHT("00"+ALLTRIM(STR(DAY(goDates.txtFromDate.Value))),2) + "}"
ldTo = "{^" + STR(YEAR(goDates.txtToDATE.Value),4)+"-"+ RIGHT('00'+ALLTRIM(STR(MONTH(goDates.txttoDate.Value))),2) +"-"+ RIGHT("00"+ALLTRIM(STR(DAY(goDates.txttoDate.Value))),2) + "}"
BTW i did turn off Strict Date but to no avail