Question : Getting todays transactions from Visual Foxpro table into Visual Studio 2008 using OLEDB

Please could someone tell me how to perform a comparison in the Visual Studio (2008 ) Query Designer against a Visual Foxpro Date field via OLEDB.

I am trying to get a list of today's transactions from a visual foxpro 9 table into an ASP.NET (c#) web page. I have created a connection to the associated DBC and it seems to work fine. I am creating a new query in visual studio 2008 using the query designer to try and just get today's transactions but I am having some problems working with the date field from VFP.

I have a Date (NOT DateTime) field in the VFP table that I want to use to give me only today's dates. In the filter column of the query designer I have tried entering various things to do this but they all seem to give me a problem. Usually either an operator/operand type mismatch or query designer can't parse the command. I have tried all of the following but the Visual Studio Query Designer doesn't seem to like any of them:
Date()
GETDATE()
Today()
{^2010-02-09}
{2010-02-09}
'{^2010-02-09}

Thanks

Answer : Getting todays transactions from Visual Foxpro table into Visual Studio 2008 using OLEDB

Interesting you've been testing values which do not work...

Correct filters are:

= { d '2010-02-09' }    ... Probably the best one for constants
= CTOD('02.09.2010')   ... American date format is probably dependent on OLE DB Provider settings
= DATETIME()              .... Current date and time
= TTOD(DATETIME())   ... Current date
Random Solutions  
 
programming4us programming4us