While browsing the Web for a solution, I discovered the operator Between
which works just fine.
Thanks anyway.
Steve
"Steve" <as RemoveThis @joe.ca> a écrit dans le message de
news:OZR3E270DHA.2868@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> I use SQL query to import data from a SQL Retriever server installed on a
> Unix Server running an Informix Database. Everything works great except a
> particular query on a period of time. I want data from let's say the
> 2003-01-01 to 2003-12-31. So I go with >= and then <=. I keep getting the
> #N/A and the result cells. If I go with >=2003-01-01 only or <=2003-12-31
it
> works but to specify dates in between, I can't get it to work. Here is the
> command line:
>
> ="DSN=OGC sys1;UID=sqlret;PWD=sqlret;Database=prog.rec2,prog.rec3"
> ="SELECT rec2.rc2_date, rec3.rc3_esc FROM prog.rec2 rec2, prog.rec3 rec3
> WHERE ((rec3.rc3_rc2_seq = rec2.rc2_seq) AND (rec2.rc2_cl1_code='"&A2&"')
> AND ('"&H1&"'>= '"&C2&"') And ('"&H1&"'<= '"&D2&"') AND ("&G2&">'0') AND
> ("&H2&"<'0'))"
>
> The H1cell refer to the date field where C2 is the beginning date and D2
is
> the ending date period. So the "And" (which is not all capital letters) is
> the problem. Like I said, if I remove the part before the And or after, I
> got the result appearing in the destination cells.
>
> So How can I specify a period of time (date that will be typed in by a
user
> in 2 cells) using greater than and smaller than on the same field?
>
> Thanks in advance.
>
> Steve Amirault
>
><!-- ~MESSAGE_AFTER~ -->