Create Runtime-SQL-Query with a date-criteria using ACCESS 97 as Frontend
Posted in 2000
Topics: General Discussion
Hello, i have a problem with creating a runtime-sql-query in access 97. access is the frontend and informix the backend. the query only works, if i use the datatype DATE and the us-english datesepartorsigns in systemcontrolpanal. but my operatingsytem is configured in german, so i have dots "." instead of slashes "/". the mistaken query is: dim ddate as date ddate = 27.09.2000 ...... WHERE field = ddate; the rifht query is: dim ddate as date ddate = 27/09/2000 ...... WHERE field = ddate; now my question: how can i solve this problem? many thanks in advance, Thomas Otto Mailto: OttoT@LSV-Gartenbau.de
Thomas Otto wrote: > i have a problem with creating a runtime-sql-query in access 97. access > is the frontend and informix the backend. > the query only works, if i use the datatype DATE and the us-english > datesepartorsigns in systemcontrolpanal. but my operatingsytem is > configured in german, so i have dots "." instead of slashes "/". > > the mistaken query is: > > dim ddate as date > > ddate = 27.09.2000 > > ...... WHERE field = ddate; Enclose the date string in quotes (single quotes for preference), and you might be in with a chance. I don't recognize the language you're using (one reason for not including the microsoft newsgroups in this response), so I'm not sure how you achieve the desired result, but the SQL should end up with a string. It might be that you need to 'dim ddate as string' -- hmmm, I take a dim view of arrays with dimension one being declared with 'dim' statements; smacks of Basic. You may also need to ensure that the locale is set correctly for Informix. I guess SETNET32 is part of that; I'd use DBDATE but you probably want the whole locale to be German, so you need to fiddle with other variables instead. The Informix documentation is at http://www.informix.com/answers (or http://www.informix.com/documentation -- it's the same page as far as I can tell). > the rifht query is: > > dim ddate as date > > ddate = 27/09/2000 > > ...... WHERE field = ddate; -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"