ComponentOne True DBInput Pro 8.0
TotalDays Method (TDBDateX)

 

Reference> TDBDateX Object> TDBDateX Object Methods> TotalDays Method (TDBDateX)

TotalDays Method (TDBDateX)

You can use the TotalDays method to retrieve the total days in the specific period by setting yeartype and periods for a given date.

Syntax

object.TotalDays ([Date], [YearType], [Periods])

Arguments

date is an optional Variant (Date): a value that determines the underlying date. If not specified, the date set in the Value property will be applied.

yeartype is an optional constant that determines whether to use the normal year or the fiscal year. The yeartype argument has these settings:

0

Normal year (Default)

1

Fiscal year

periods is an optional constant that determines which period to use in date calculations. The periods argument has these settings:

0

Year (Default)

1

First half

2

Second half

3

First quarter

4

Second quarter

5

Third quarter

6

Fourth quarter

7

Month

Return Value

An integer corresponding to the total number of days within the specified period. If date is set to Null or the target date is not within the specified period, this method returns -1.

Remarks

For example, Aug. 20, 1998 will return 365 for the total days of year and 181 for the total days for the first half of the year.

The date for the fiscal options will be calculated based on the month set by the FirstMonth property.

If date is not specified, the date set in the Value property will be applied for the underlying value.

When periods is set to 7-Month, the yeartype option will be ignored, since the type for the year will not make much sense in this case.

The day part for the underlying date may not have any particular meaning, but it is still required since the date must be defined as a valid Date type.

See Also

Value Property (TDBDateX)

FirstMonth Property (TDBDate)

Year Property (TDBDateX)

Half Property (TDBDateX)

Quarter Property (TDBDateX)

FiscalYear Property (TDBDateX)

FiscalHalf Property (TDBDateX)

FiscalQuarter Property (TDBDateX)

Month Property (TDBDateX)

TotalWeeks Method (TDBDateX)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback