Logical expressions in dynamic selections

We have already discussed the creation of selections at runtime in an article. The focus of Artikels was the formulation of queries on linked tables. In today’s article, I would like to discuss the structure of logical expressions in dynamic selections.


When using dynamic selections, a logical expression is used to decide whether or not the data set is included in the selection set. To achieve this, conzept provides 16 different comparison operators (=, >, between[ …)]. The query itself is defined with function SelDefQuery(). As the instruction expects a string, there are a few points to consider when creating a logical expression.

Use of constants:

When using constants of type Alpha, please note that these are enclosed in double apostrophes (‘). Within instruction SelDefQuery(), these double apostrophes are changed to single apostrophes.

tHdlSel->SelDefQuery('', 'ART.aBezeichnung =* ''Software*''');
Use of variables:

In general, it can be said that variables are not part of the query. However, this changes when the content of the variable is inserted into the query string. From this point on, the content of the variable is part of the query. If a variable of type Alpha is to be inserted within this, it must be enclosed in brackets with double apostrophes. Within the query string, the double quotation marks are changed to single quotation marks.

tHdlSel->SelDefQuery('', 'ART.aBezeichnung =* ''' + tValue + '''');

If the variable is not available as an alpha type, it must be converted accordingly and also masked with apostrophes. This masking is converted accordingly within the instruction.

tHdlSel->SelDefQuery('', 'ART.iNummer >= ' + CnvAI(tValue));
Special feature of the data types ‘Date’ and ‘Time’:

If the variable is of type Date or Time, there is a special feature worth noting here during conversion. The display of the time or date format usually depends on the country-specific settings of the operating system. If these are set to the format ‘YYYY-MM-DD’, for example, a conversion without specifying a format option returns the following string:
'KND.dEintrDatum = 2015-02-24'
Dieser String verursacht den Fehler Incorrect data type (_ErrParserWrongType), da an dieser Stelle zwingend das Datumsformat ‘day.month.year’ ('24.02.2015') erwartet wird. Um den Fehler zu vermeiden, ist bei der Konvertierung zwingend die Formatoption _FmtInternal anzugeben. Wird diese Formatoption angegeben, führt dies zu einem immer gleichen Ausgabeformat und dies unabhängig der länderspezifischen Einstellungen. Der String besitzt somit folgendes Aussehen: 'KND.dEintrDatum = 24.02.2015'
This string causes the error A (B), as the date format C (D) is expected at this point. To avoid this error, the format option E must be specified during conversion. If this format option is specified, this always results in the same output format, regardless of the country-specific settings. The string therefore has the following appearance: F

Variable of the type Date:

tHdlSel->SelDefQuery('', 'KND.dEintrDatum = ' + CnvAD(tValue, _FmtInternal));


Variable of the type Time:

tHdlSel->SelDefQuery('', 'KND.tEintrZeit = ' + CnvAT(tValue, _FmtInternal));

It may also be necessary to specify format option _FmtInternalwhen converting numeric variables. The reason for this can also be found in the country-specific settings of the operating system. The default setting for numbers is digit grouping, which inserts a dot after every third number. If a conversion is now carried out without a format option, the dot is also inserted in the query string, which ultimately leads to error _ErrParserWrongType.

Klicken Sie hier, um die Nutzungsbedingungen für unseren Blog zu lesen.

Leave a Reply

Your email address will not be published. Required fields are marked *

Leave the field below empty!

Requests, questions or feedback are welcome:

Terms of use of the comment function in the blog

1. General information

Vectorsoft AG (‘Provider’) provides a public blog for Internet users (‘Users’) on the vectorsoft.de website. The public blog is intended for the exchange of information and ideas. Users who participate with contributions and comments undertake to comply with the blog terms of use and are responsible for the accuracy, appropriateness and freedom from legal infringements of their contributions. By using the comment function in our blog, you accept these terms of use.

2. Netiquette

We ask you to refrain from personal attacks and provocations based on other opinions. Please argue objectively and maintain a constructive discussion culture. Your comment should always be related to the topic in question in order to avoid digressions into other topics. Posting the same comment or several similar comments more than once is not permitted.

3. Prohibition of illegal content

By submitting your comment, you confirm that you are not violating any copyrights or other rights of third parties. Inciting, racist statements, instructions for criminal offences and their glorification, depictions of violence, pornographic content and statements that violate personal rights are prohibited.

4. No advertising

The use of the comment function is not permitted for commercial or party-political purposes. Advertising contributions of any kind will be deleted immediately.

5. Details of the name

When entering your name, pay attention to the principles mentioned above.

6. Source references

If you intend to publish quotes or contributions from third parties, please indicate the respective sources and explain how they relate to the blog post.

7. Violation of the terms of use

Posts that violate this policy will be deleted immediately. If you notice any violations yourself, please send us the link to the comment in question by e-mail to . We expressly point out that we will exclude individual users in the event of repeated or serious violations of these terms of use.

As of: Sept. 2024

Get your Trial Version now!

Test yeet free of charge

IHRE EVALUIERUNGSLIZENZ - JETZT ANFORDERN!

TESTEN SIE DIE CONZEPT 16 VOLLVERSION - UNVERBINDLICH und KOSTENFREI

Subscribe to our newsletter

[cleverreach_signup]
WordPress Cookie Notice by Real Cookie Banner