ComponentOne True DBInput Pro 8.0
PickDate Method (TDBDateX)

 

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

PickDate Method (TDBDateX)

You can use the PickDate method to pick and retrieve the nth day of the specified period such as (fiscal) year, (fiscal) first half of the year, and so on.

Syntax

object.PickDate ([Date], nthDay, [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.

nth is a required integer: a number which determines nth day to return.

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

A date value within the specified period. If date is set to Null or the target date is not within the specified period, this method returns Null.

Remarks

For example, with the underlying date set to March 15, 1998, 100th day of the year will return Apr. 10, 1998 and 50th day of the second half of year returns Aug. 19, 1998.

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

The PickDate method does not allow you to set the nth argument to more than the total days existing in the specified period. For example, if set yeartype to 0-dbiNormalYear and periods to 0-dbiYear, the available numbers will be limited from 1 to 365 or 366. If you happen to set a day larger or smaller than the specified range, the value will be automatically rounded to the smallest and the largest value available.

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)

 

 


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

Product Support Forum  |  Documentation Feedback