Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a need to select data from a QVD file based on the contents of an excel spreadsheet, the added complication is that I need to match only on part of the string, I can build the string from the spreadsheet ok.
Example:
// String build from Spreadsheet
LET String="a like 'fre%' or a like 'ber%'"
In SQL speak I could do
select a, b, c
from table
where ($(String));
Is there a way of doing it from a QVD file ?
Thanks
Tony
Hi Tony,
Yes, that would work in SQL but in QV you would need to use MATCH() or WILDMATCH() functions. So something like below should work fine:
let mask1 = chr(39) & 'fre*' & chr(39);
let mask2 = chr(39) & 'ber*' & chr(39);
LET String = 'WILDMATCH(a, ' & mask1 & ') > 0 OR WILDMATCH(a, ' & mask2 & ') > 0' ;
LOAD a FROM a.qvd (qvd)
WHERE $(String);
Hi Tony,
Yes, that would work in SQL but in QV you would need to use MATCH() or WILDMATCH() functions. So something like below should work fine:
let mask1 = chr(39) & 'fre*' & chr(39);
let mask2 = chr(39) & 'ber*' & chr(39);
LET String = 'WILDMATCH(a, ' & mask1 & ') > 0 OR WILDMATCH(a, ' & mask2 & ') > 0' ;
LOAD a FROM a.qvd (qvd)
WHERE $(String);
The following code should help...
LOAD * FROM FileName.QVD (qvd) WHERE WILDMATCH(FieldName, '*ZZ*');
Thanks That worked perfectly
Tony