WHERE-Statement

Pagina: 1
Acties:
  • 25 views sinds 30-01-2008

  • Vincent Veeger
  • Registratie: December 2005
  • Laatst online: 01-12 00:03
using DAO/Jet on .dbf files,

I got the following WHERE statement in a large SELECT-statement:

WHERE fonds.codnr LIKE '%%port.mabelcode2'

It should be valid if field codnr in table fonds for example contains "0000123" and field mabelcode2 in table port contains "123" (both fields of type chr)

Problem is that '%%port.mabelcode2' does not translate into "%123".

If I remove the quotes it generates a syntax error. If I change '%%port.mabelcode2' into '%%123' it works (valid record).

How can I use the contents of field "mabelcode2" as the "seed" in the LIKE-statement?

  • P.O. Box
  • Registratie: Augustus 2005
  • Niet online
probeer eens
LIKE CONCAT('%%', port.bruinsmacode2);

of

LIKE '%%' & port.bruinsmacode2

of

LIKE '%%' + port.bruinsmacode2

[ Voor 5% gewijzigd door P.O. Box op 30-03-2007 14:36 ]


  • whoami
  • Registratie: December 2000
  • Laatst online: 00:54
Als je je vraag op verschillende fora stelt, mag je wel minstens de moeite doen om 'm hier in het nederlands neer te zetten.

https://fgheysels.github.io/


Dit topic is gesloten.