QueryField Class Properties

In this section, we discuss the QueryField class properties. The properties are discussed in alphabetical order.

Description

This property returns or sets the aggregate type for the query field.

This property takes either a constant or numeric value. The values are:

Numeric Value

Constant Value

Description

1

%Query_TtlNone

Query field has no total

2

%Query_TtlSum

Query field is for Sum

3

%Query_TtlCount

Query field is for Count

4

%Query_TtlMin

Query field is for Minimum

5

%Query_TtlMax

Query field is for Maximum

6

%Query_TtlAvg

Query field is for Average

This property is read-write.

Description

This property returns or sets the column number for the query field as a number. If the column number is greater than zero, the field is an output field.

This property is read-write.

Description

This property returns the long description of the field as a string. This same value is returned by the Description property of the QueryDBRecordField class.

The length of this property is 30 characters.

This property is read-only.

Description

This property returns the decimal positions QueryField as a number. This same value is returned by the Decimal property of the QueryDBRecordField class.

This property is read-only.

Description

This property returns or sets the Expression Number for the field. This value is 0 for non-expression fields. If the field is created for an expression, this value is the same as the expression number of the corresponding expression. This property takes a number value.

This property is read-write.

Description

This property returns the Use Edit flag for the Query Field. It has the same values as returned by the Flag property of the QueryDBRecordField. This property takes a number value.

This property is read-only.

Description

This property returns the field format for the query field. This property returns a string value. This property is useful for displaying the data type in a string format.

Values are:

Data Type

Value Returned

Character

“CHAR “

Long character

"LONG CHAR "

Number

"NUMBER "

Signed number

"SIGNED "

Date

"DATE "

Time

"TIME "

DateTime

"DATE/TIME "

Image

"IMAGE "

This property is read-only.

Description

This property returns or sets the heading text for the query field as a string.

The length of this property is 30 characters.

This property is read-write.

Description

This property returns or sets the heading type for the query field. This property takes either a numeric or constant value. The values are:

Numeric Value

Constant Value

Description

1

%Query_HdgNone

Query field has no heading.

2

%Query_HdgText

Query field has a text heading.

3

%Query_HdgRftShort

Query field uses the short RFT heading.

4

%Query_HdgRftLong

Query fields uses the long RFT heading.

This property is read-write.

Description

This property returns or sets the unique field name for the heading. The default value for this property is the record alias combined with the field name.

The length of this property is 30 characters.

This property is read-write.

Description

This property returns the length of the Query Field. The same value is returned by the Length property of the QueryDBRecordField. This property takes a numeric value.

This property is read-only.

Description

This property returns the long name of the Query Field. The same value is returned by the Long Name property of the QueryDBRecordField. This property takes a string value.

The length of this property is 30 characters.

This property is read-only.

Description

This property returns the name of the query field as a string.

The length of this property is 18 characters.

This property is read-only.

Description

This property returns or sets the order by direction. This property takes a numeric value. The constants are the ASCII codes for space (" ") and "D".

Values are:

Numeric Value

Constant Value

Description

32

Code (" ")

Ascending

68

Code("D")

Descending

This property is read-write.

Example

The following sets the order by direction to be ascending.

&QueryField.OrderByDirection = Code(" ");

The following sets the order by direction to be descending.

&QueryField.OrderByDirection = Code("D");

Description

Use this property to specify whether a field is used as part of an 'Order By' statement in the SQL. The number value of this property indicates which is the first field in the order by statement, which is the second, and so on.

This property is read-write.

Example

To order a query by one field, you must set the OrderByNumber property for the other QueryFields as well, specifying the primary field as 1, the next field as 2, and so on.

&QryFld = &MainQrySel.AddQuerySelectedField("PSRECDEFN", "A", "RECNAME", "Record Name"); 
&QryFld.ColumnNumber = 1; 
&QryFld.OrderByNumber = 1; 
 
&QryFld = &MainQrySel.AddQuerySelectedField("PSRECDEFN", "A", "RECDESCR", "Record Descr"); 
&QryFld.ColumnNumber = 2; 
&QryFld.OrderByNumber = 2; 
 
&QryFld = &MainQrySel.AddQuerySelectedField("PSRECDEFN", "A", "RELLANGRECNAME", "Record Lang Rec"); 
&QryFld.ColumnNumber = 3; 
&QryFld.OrderByNumber = 3;

Description

This property returns a reference to the QueryRecord containing this QueryField. If the field has no QueryRecord (that is, that this field is an expression field), this property returns NULL.

This property is read-only.

Example

&QryRcd = &QryFld.QueryRecord;

Description

This property returns the record alias for the Query Field as a string. This value is usually a value like "A", "B", and so on. The same value is returned by the RecordAlias property for QueryRecord.

The length of this property is 1 character.

This property is read-only.

Description

This property returns the short name of the Query Field. The same value is returned by the ShortName property for QueryDBRecordField. This property takes a string value.

The length of this property is 15 characters.

This property is read-only.

Description

This property returns or sets the effective date logic for the QueryField.

The values are:

Numeric Value

Constant Value

Description

1

%Query_ExprCurDt

Current Date

2

%Query_ExprField

Field

3

%Query_Expression

Expression

This property is read-write.

Description

This property returns a reference to an expression object based on a translate field if the Translate Effective Date option refers to an Expression

This property is read-only.

Related Links

QueryExpression Class

Description

This property returns a reference to a QueryField object for a translate field if the Translate Effective Date Option refers to a field.

This property is read-only.

Related Links

QueryField Class

Description

This property returns or sets the translate value for the QueryField. This property takes a numeric or constant value. The values are:

Numeric Value

Constant Value

Description

1

%Query_XlatNone

None

2

%Query_XlatShort

Short

3

%Query_XlatLong

Long

This property is read-write.

Description

This property returns the type of the field. You can use either a numeric or constant value. The values are:

Numeric Value

Constant Value

Description

0

%FieldType_Char

Character

1

%FieldType_LongChar

Long Character

2

%FieldType_Number

Number

3

%FieldType_SignedNumber

Signed number

4

%FieldType_Date

Date

5

%FieldType_Time

Time

6

%FieldType_DateTime

DateTime

8

%FieldType_Image

Image

8

%FieldType_File

File

9

%FieldType_ImageRef

ImageReference

Note: The Image and File types can be differentiated using the GetImageFormat method of the QueryField class.

This property is read-only.