Home All Groups Group Topic Archive Search About

Filtering Rows With SQL Select

Author
19 Jan 2006 5:16 AM
latin & geek via DotNetMonster.com
hi.

ive been trying to filter rows from an access table with the sql select
command, this is the line i used:

sql1 = "SELECT cus1,wexp,sno, model, invdate, invno,amt, equip, roll FROM
amc1 WHERE branch like '" & x & "' AND invdate < 'dateto'"

the 'where' bit works, but the invdate filter doesnt. however, there are also
no error messages - the pgm runs ok.
any ideas anyone?

thanks.

--
it's all latin & geek to me! ;-)

Message posted via http://www.dotnetmonster.com

Author
19 Jan 2006 11:55 AM
Ken Tucker [MVP]
Hi,

        You are always comparing invdate to a string dateto

'dateto'"

You should try something like this

'" & dateto.tostring & "'"

Ken
-----------------------
"latin & geek via DotNetMonster.com" <u16975@uwe> wrote in message
news:5a931c3af42df@uwe...
Show quoteHide quote
> hi.
>
> ive been trying to filter rows from an access table with the sql select
> command, this is the line i used:
>
> sql1 = "SELECT cus1,wexp,sno, model, invdate, invno,amt, equip, roll FROM
> amc1 WHERE branch like '" & x & "' AND invdate < 'dateto'"
>
> the 'where' bit works, but the invdate filter doesnt. however, there are
> also
> no error messages - the pgm runs ok.
> any ideas anyone?
>
> thanks.
>
> --
> it's all latin & geek to me! ;-)
>
> Message posted via http://www.dotnetmonster.com