On 3/3/07, Ian M. Jones <[EMAIL PROTECTED]> wrote: > > On 3 Mar 2007, at 03:49, Dennis Birch wrote: > > > I've saved my REALSQLDatabase-based application's date data in date > > columns (e.g. field.DateValue = d). Now how do I write an SQLSelect > > statement that can compare a given date with what I've saved in the > > database? You obviously can't write "SELECT * FROM myTable WHERE > > entryDate = d. I've tried using "d.SqlDate", but that doesn't work. > > What does? > > You generally have to quote dates, so the following should work: > > strSQL = "SELECT * FROM myTable WHERE entryDate = '" + d.SQLDate + "'" > > Is that what you've tried already?
Yes. I've tried it with single and double quotes. I've tried it with a SQL date as a string literal. Nothing works. If I specify a date, I get 0 records when I use a known good date. I can see that the dates are stored in the table in SQL date format by selecting the table contents with no conditions (SELECT * FROM de_DataEntryTable) and showing every field's stringvalue. So I'm confused as to why I can't select on a date using the following: SELECT * FROM DataEntryTable WHERE de_EntryDate = "2002-10-28". _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
