SQL question // LIKE on date

Florian Bogeschdorfer fb at memedia.de
Thu Nov 11 20:31:42 CST 2004


> > 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
> 
But I tried fld LIKE '...07.....' ignoring the "."s as seperators... And
still no result, actually I even tried fld LIKE '..........' and got an
empty cursor

Best regards, Florian 



More information about the Valentina mailing list