On May 19, 2008, at 8:42 PM, Skip Evans wrote:

> Hey all,
>
> For the life of me I can't figure out why the
> following statement returns no rows:
>
> SELECT productcodesize,options FROM bsp_options
> WHERE modelID=351 AND '1990' >= startyear AND
> '1990' <= endyear

My guess is that you are storing endyear as an integer within a column  
with no affinity.  And an integer is always less than a string so  
'1990'<=endyear is always false.  What is your table schema?  Have you  
tried:

   WHERE modelID=351 AND CAST(startyear AS INT)<=1990 AND CAST(endyear  
AS INT)>=1999

>
>
> I'm looking right now at a printout of records
> from the query:
> SELECT productcodesize,options FROM bsp_options
> WHERE modelID=351
>
> Where the fields are:
>
> modelID: 351 startyear: 1990 endyear:1993
>
> ..and there are a bunch of them.
>
> Can anyone spot anything wrong with that query???
>
> Thanks!
>
> -- 
> Skip Evans
> Big Sky Penguin, LLC
> 503 S Baldwin St, #1
> Madison, WI 53703
> 608-250-2720
> http://bigskypenguin.com
> =-=-=-=-=-=-=-=-=-=
> Check out PHPenguin, a lightweight and versatile
> PHP/MySQL, AJAX & DHTML development framework.
> http://phpenguin.bigskypenguin.com/
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>

D. Richard Hipp
[EMAIL PROTECTED]



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to