On Wed, May 11, 2011 at 1:16 PM, Rafael Copquin <[email protected]> wrote: > Thank you Fred > > This works very well > > And also thanks to Ted Roche for his suggestion of using named parameters > > What I am using is a literal such as cCmd > > dDate = date() > cCmd = 'select * from invoices where invdate= '+'{'+dtoc(dDate)+'}' > > nResult = SQLEXEC(nHandle, cCmd,'curInvoices') > > But if I use a named parameter, with the ? operator, I guess it would work > as well > > I thought that there must be a better way but for some reason, MS built into > SQL Server Express 2008 many date functions but omitted an equivalent to the > VFP date() function. Why?? --------------
Because they knew that the world was smarter? Because the VFP date screws up everywhere else? Because Date is just a collection of all seconds that transpire between midnights? Because they bought it that way from Sybase. Because they copied the way Oracle did it?. I could go on. In reality a date is not only the calendar 5-11-11 but also the time 13:21 You can google for samples on how to do a between clause that can take your '5-11-11' and wrap the first second to the start and the last second of the day to the ending date. giving you : Where i.InvoiceDate between sDate and eDate -- Stephen Russell Unified Health Services 60 Germantown Court Suite 220 Cordova, TN 38018 Telephone: 888.510.2667 901.246-0159 cell _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

