I have a situation where I have to add a "BETWEEN ? AND ?" condition
to a set of queries. The strangest thing happens though - certain
values get turned into floats.
Here's an example of the conditions that CakePHP sends to model-
>find():
[code]
Array
(
[SurveyData.SS_COMPLETE] => 1
[AND] => Array
(
[0] => Array
(
[NOT] => Array
(
["T29_1"::integer] =>
)
[SurveyData.SS_COMPLETE] => 1
)
[1] => Array
(
["T39_3"::integer BETWEEN ? AND ?] => Array
(
[0] => 22
[1] => 36
)
)
)
)[/code]
Seems straightforward enough right? Here's the query that gets
generated:
SELECT [...] AS "SurveyData" WHERE "SurveyData"."SS_COMPLETE" = '1'
AND ((((NOT ("T29_1"::integer IS NULL)) AND
("SurveyData"."SS_COMPLETE" = '1'))) AND ("T39_3"::integer BETWEEN
'22' AND '36.000000'))
>From what I can tell, it only seems to happen when the value is '36'
and it doesn't matter if it's after the "BETWEEN" word or after the
"AND" word. The field "T39_3" is a text field and that cannot be
changed on the table itself, hence why I am converting to ::integer.
Any idea what could be causing this?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php