[V4RB] Query returning unmatched records ( DATE BETWEEN xxx AND yyy )

Ivan Smahin IvanSmahin at public.kherson.ua
Fri Dec 9 16:18:47 CST 2005


Hello Stan,

Thursday, December 8, 2005, 7:34:15 PM, you wrote:

SB> Hi,

SB> Yes, this is true, I read this in SQL92 doc as well but seems it  
SB> doesn't work with Valentina.

SB> This:
SB> fldDate BETWEEN 'MM/DD/YYYY' AND 'MM/DD/YYYY'
SB> returns the right record number.

SB> This:
SB> fldDate BETWEEN DATE 'MM/DD/YYYY' AND DATE 'MM/DD/YYYY'
SB> never returns records. Never raises an exception either.

SB> Stan

>> SB> Interesting, I searched the web on how do to that, so:
>>
>> SB> WHERE ( myDate BETWEEN date'1/1/2001' AND date'1/31/2001' )
>>
>> SB> is correct? If so I will try it. myDate is a DateTime field.
>>

I'm sorry I have missed that you operate with DateTime field.
So you should use DateTime literals.

WHERE ( myDate BETWEEN datetime'1/1/2001' AND datetime'1/31/2001' )

-- 
Best regards,
 Ivan                            mailto:IvanSmahin at public.kherson.ua



More information about the Valentina mailing list