SQL question // LIKE on date

Florian Bogeschdorfer fb at memedia.de
Fri Nov 12 09:46:48 CST 2004


Good morning Ruslan!

Let's first finish the LIKE thing. 

I have a fld kTypeDate
You say "." is a RegEx control character and is a placeholder for any
character?

Now if I have a record with fld="12.07.2004" why wouldn't it find it
searching with fld LIKE "12.07.2004". Since "." is a placeholder it should
find the dots in "12.07.2004" as well as a field like "12?07!2004"? NOT?

And why does fld LIKE ".........." does return an empty cursor? Why does it
not find ALL dates?

Best regards, Florian


> 
> > > 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 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list