Hi Simon. 

Ah. So what I need to do then is to make the return of strftime of type INT.

Since I'm creating a recordset from an existing table (rather than creating
a table itself), then I don't have the option to set the affinity of my
newly created column Day to INT.

Can CAST(strftime('%d', Date), INTEGER) be used in this context, or is there
another way?

Thanks!


Rick
 

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Davies
Sent: Monday, July 06, 2009 4:44 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Query by Day

2009/7/6 Rick Ratchford <r...@amazingaccuracy.com>:
> Greetings!
>

Hi Rick,

> I'm having trouble with what I thought would be a simple SQL query.
>
>    SQLString = "SELECT strftime('%d', Date) as Day, IsSwingTop1 as 
> Tops,
> IsSwingBtm1 as Btms " & _
>                "FROM TmpTable WHERE Day = 11"
>
> I'm trying to create a recordset where the only records returned are 
> those that fall on the 11th of the month.
>
> When I run this without the 'WHERE Day = 11", it returns all the 
> records in
> 3 columns, Day, IsSwingTop1 and IsSwingBtm1. Under the Day column, I 
> can see all the days as 01, 02...31.

That's good...

>
> I'm not sure where I'm making my logic error.

...and you think that there is a problem because?

It would really help if you explained what leads you to believe that there
is a logic error.

>
> Thanks.
>
> Rick
>

If you use typeof() around "strftime('%d',date)", it shows type TEXT.
You are comparing this with an INTEGER; never true.

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



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

Reply via email to