Subject Re: [firebird-support] Re: SELECT returns no data
Author André Knappstein, Controlling
e> I confirmed there existed data by

SQL>> SELECT D, T, P, V FROM T_10199000 WHERE D <= '2011-05-30' AND T='00:00:00:0001';

e> D T P V
e> =========== ============= ======================= ==============
e> 2011-05-30 00:00:00.0001 279.2000122070313 6050.0000
e> 2011-05-27 00:00:00.0001 275.2500000000000 659.00000

e> Would you check again please?

I'll try :)

>> WHERE
>> (D >= '2011-05-29' AND T >= '15:00:00.0001')
>> AND
>> (D <= '2011-05-30' AND T <= '14:59:59.9999')

2 expressions in the "WHERE" clause, concatenated by logical AND:

First expression: (D >= '2011-05-29' AND T >= '15:00:00.0001')
- evaluates to "false" for row 1; T is too small
- evaluates to "false" for row 2; D is too small
== first expression evaluates to "false" for all rows

Now it does not matter what the second expression would evaluate to, because "false" + "something" should always evaluate to "false" and so none of the 2 records you confirmed will be matching.


This is exactly the place where using TIMESTAMP(=DateTime) type fields still make things easier.

---