Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 9 Jahren, 1 Monat
Letzter Beitrag:
vor 9 Jahren, 1 Monat
Beteiligte Autoren:
Michael Drechsel, Piet van Zanten, Al, Fabrice Harari, Stefan Bentvelsen, Paulo Oliveira

Qry Design Problem

Startbeitrag von Michael Drechsel am 17.06.2009 14:44


I have to files in WD14:

File A:

Plan-Number, Date

File B:

Plan-Number, filename,filesize

The "plan-number" is the key for these 2 files.

The question is: Are there files in file B with file extension like ".pdf " ?

How can I create a qry for these question ? I tried something with a subquery and "is in the list .." but it does´nt work.

Because the File A has dozen of fields I would prefer the query editor ...

Any ideas ???


Hi Michael,

have you tried something like this:

WHERE filename LIKE '%.pdf'

for all Plan_numbers with files with .pdf in the file extension ?

von Stefan Bentvelsen - am 17.06.2009 14:59
Hi Michael...

considering that your query would mean testing on CONTAINS, which is the worse possible case (every record has to be read), I would suggest that you add an 'extension' field to your file with just the file extension in it... Then do the query on that field

Best regards

von Fabrice Harari - am 17.06.2009 15:02
Hi Stefan,

thx, it´s clear, but I wan´t it do in one query with the editor. But I think its impossible.

von Michael Drechsel - am 17.06.2009 15:04
the query proposed by stefan is possible in the editor, i didn't test it in V14 but in V11 is possible.
In the editor select from the file A the Plan-Number, Date columns
Then select from file B Plan-Number, filename,filesize
In the file B Plan-Number define one condition (contains the value pdf)
If you need to remove duplicates, click the buttom Delete Duplicates

PS: This is true if in the analysis file A and file B are linked.

von Paulo Oliveira - am 17.06.2009 15:32
Hi Paulo,

it doesn´t work because:

If I link File A and B with a outer join with the plan_number as link and allow a record A without B (because not every plan_number in A has a filename in B ) the filter "filename contains ..." doesn´t work.

von Michael Drechsel - am 17.06.2009 18:31
Hi Michael,

There's an option in the query editor to create calculated items.
Click the button on the left, then you can select Wlanguage functions.
Choose fExtractpath(fExtension) to create the calculated item.


von Piet van Zanten - am 17.06.2009 20:11
Hi Piet,

thx, but this is not my problem. See the post before.

von Michael Drechsel - am 18.06.2009 06:49
Hi Michael,

As I understand you want to check the file extension.
If you create a calculated item, then you can create a selection condition (with parameter) on that item. To me that seems a clear solution. Or do I misunderstand the problem?


von Piet van Zanten - am 18.06.2009 07:31
The join doesn´t work.

But its ok, I try another solution with 2 querys.

von Michael Drechsel - am 18.06.2009 07:36
Hello Michael

In the quest to solve the query issue, everyone seems to be overlooking Fabrice's suggestion, which in my opinion solves the entire problem very neatly. If you can adjust the database and add an "extension" field and index on it, then your query will be very simple and very quick. You can populate the new field from the existing data very easily with FExtractPath().


von Al - am 18.06.2009 09:48


If you join 2 files in the query editor and you allow show records from file A without records from file B (because not even record in file A has a record in File B) the filter does´t work.

For example:

If no record contains "*.pdf" all records in File A are displayed !!

The file extension filter is used for my clients to seperate optional a set of displayed records.

von Michael Drechsel - am 18.06.2009 09:56
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.