That's the clincer. The resulting DATE column is actually the format of the equation as well.
I've attached a view of the results from the working SQL statement that does not perform the WHERE. "WHERE Format$(Date, 'yyyy-mm-dd') < sDateTemp" does not work. Also, as stated in my previous post, I have sDateTemp formatted in the same format as that which is in the table. That's why I'm puzzled. Rick #>-----Original Message----- #>From: sqlite-users-boun...@sqlite.org #>[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik #>Sent: Monday, August 03, 2009 1:38 PM #>To: sqlite-users@sqlite.org #>Subject: Re: [sqlite] Date Comparisons SQL #> #>Rick Ratchford wrote: #>> The Date is being stored as yyyy-mm-dd. Note the "Format$(Date, #>> 'yyyy-mm-dd') as Date" that assures this. #> #>The "Date" that appears in the WHERE clause is the value of #>the Date column in the table, not the value of the expression #>with the "Date" #>alias. You can't actually use aliases in the WHERE clause. #>You are confusing yourself by using the same identifier both #>for the column name and for the alias. #> #>You could write #> #>WHERE Format$(Date, 'yyyy-mm-dd') < sDateTemp #> #>Or else, express sDateTemp in the same format that you have #>dates stored in the table - the format you get when you just #>run "SELECT Date from mytable". #> #>Igor Tandetnik #> #> #> #>_______________________________________________ #>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