I'm really confused over dates between FoxPro and SQL Server. I'm trying to use FoxPro to pull back records from our SLQ Server 2008 - I need all records between 1/03/2011 and 1/07/2011 from the server to a FoxPro cursor. This part works well but it's very manual using
"between convert(datetime,'2011-01-03') and convert(datetime,'2011-01-07')"
SO now I want to automate pulling in the Monday and Friday dates. Using some code I found here gives me Monday and Friday perfectly:
someDate = DATE()
lastMonday = m.someDate - DOW(m.someDate,1) - 5
lastFriday = m.someDate - DOW(m.someDate,1) - 1
but the dates won't work in the query as FoxPro returns them OR I just don't know how to make it work - the cursor is empty every time. How can I format the lastMonday and lastFriday dates so they will work in the query of the SQL Server?
"between convert(datetime,'2011-01-03') and convert(datetime,'2011-01-07')"
SO now I want to automate pulling in the Monday and Friday dates. Using some code I found here gives me Monday and Friday perfectly:
someDate = DATE()
lastMonday = m.someDate - DOW(m.someDate,1) - 5
lastFriday = m.someDate - DOW(m.someDate,1) - 1
but the dates won't work in the query as FoxPro returns them OR I just don't know how to make it work - the cursor is empty every time. How can I format the lastMonday and lastFriday dates so they will work in the query of the SQL Server?