Re: VB, Informix and selecting by date woes
Posted in 2000
Rob Stevens wrote:
>
> I want to run a select statement from vb which selects by a date. With an
> access databse I would do (for example):
>
> rs.Open "SELECT * From member WHERE l_date_joined = #3/29/2000#", cn
>
> but informix dosn't like this and complains bitterly!!!
>
> how can I achieve what I'm after? what am I doing wrong?
>
> I'm using VB6, ADO, Informix client sdk (odbc driver ver 3.31), informix se
> v.7.23 (apparently) and windows 2000.
>
Have you tried:
SELECT * From member WHERE l_date_joined = "3/29/2000"
SQL will not like the hash signs, which it takes as comment
characters. Quoting the date string instead may well fix it. I
don't know about Visual Basic (am I the only person in the world
who's never used it?) but in other languages you can get round
the problems of a string containing quotes by using two kinds of
quotes "SELECT * From member WHERE l_date_joined = '3/29/2000'"
or by escaping the quotes with a backslash (which is very hard to
find on a Swiss-german keyboard, but I digress).
Do you have access to the Informix manuals? The SQL manual is on
line at www.informix.com/answers somewhere.
--
In article <3978CFF0.CB1B2BB2@my-deja.com.guacamole>,
stacia123@my-deja.com.guacamole said:
> Goldfish don't fit through the air nozzle of most erotic dolls.