SQL question // LIKE on date

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Nov 11 21:26:41 CST 2004


On 11/11/04 9:09 PM, "Florian Bogeschdorfer" <fb at memedia.de> wrote:

> Ruslan, I tried a lot again...
> 
> I think that RegEx search (LIKE) does not work for fields kTypeDate?
> 
> See:
> y=valselectreturncursor("SELECT geburtsdatum FROM KUNDENTable WHERE
> geburtsdatum = '12.07.1970'")
> 
> put valcursorreccount(y)
> -- 2
> 
> y=valselectreturncursor("SELECT geburtsdatum FROM KUNDENTable WHERE
> geburtsdatum LIKE '12.07.1970'")
> 
> put valcursorreccount(y)
> -- 0
> 
> 
> ?

Mistake Florian.

LIKE in Valentina .x works as REGEX

As I see in German you use '.' as date separator.

But you should note that DOT is control character in REGEX.

        fld LIKE '12.07.1970'
                    ^  ^ ops

Must be escaped

        fld LIKE '12\.07\.1970'

So if you want find only month 07

        fld LIKE '..\.07\.....'


The first 2 DOTs -- are placeholders of SINGLE character.

Third DOT is escaped so REGEX will consider it as character

And so on





-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------




More information about the Valentina mailing list