|
|
|
|
|
GetDBDate - Formatting a date as a DateSerial for Access
|
Total Hit (2895) |
«Code LangId=1»' Format a date as a DateSerial for Access
' Example: Debug.Print GetDBDate(date)
Public Function GetDBDate(sDate As String) As String
On Error GoTo ERROR_GetDBDate
Dim sTmp As String
If IsDate(sDate) = False Then
sTmp = sDate
Else
sTmp = "DateSe
....Read More |
Rating
|
|
|
GetRoshHashanah - Get the date of Rosh Hashanah (Jewish calendar)
|
Total Hit (2890) |
«Code LangId=1»' Returns the date that Rosh Hashanah begins
' for the requested year. It is important to note that
' Rosh Hashanah is based on the Lunar cycle so the Holiday
' actually begins at sunset of the day before the date
' returned by this function.
' Note: Many dates in the Jewish
....Read More |
Rating
|
|
|
IsValidDateField - Check whether a date is valid
|
Total Hit (3443) |
«Code LangId=1»Enum psDateTypes
AnyValidDate 'Allows any valid date to be entered
PastDate 'Only allows past dates (before today) to be entered
FutureDate 'Only allows future dates (after today) to be entered
TodayOrFuture 'Only allows today or future date to be
....Read More |
Rating
|
|
|
Monday - retrieving the date of the Monday for a specified week
|
Total Hit (2785) |
«Code LangId=1»
' Return the date of the Monday for a specified week..
' This function can be tweaked to return any weekday. I use it in Access to
' subdivide reports into weekly units, since Access displays only a number
' between 1 and 53 for the week when you group dates by week.
'
' Note
....Read More |
Rating
|
|
|
|
|
|
|
|
TimeToString - Convert time to a descriptive string
|
Total Hit (3862) |
«Code LangId=1»' convert a date value into a string in the format
' YY years, MM months, DD days, HH hours, MM minutes, SS.HH seconds)
' you can also opt for time short format (HH h, MM m, SS s)
Function TimeToString(ByVal aDate As Date, Optional ShortTimeFormat As Boolean, _
Optional
....Read More |
Rating
|
|
|
Age - Evaluating the age of a person, given his/her birth date
|
Total Hit (2140) |
«Code LangId=2»' Evaluate the age of a person, given his/her birth date
' Example: Debug.WriteLine(Age(#9/28/1980#)) ' => 22
Function Age(ByVal birthDate As Date, Optional ByVal currentDate As Date = #1/1/ _
1900#, Optional ByVal exactAge As Boolean = True) As Integer
If currentDate
....Read More |
Rating
|
|
|
|
|
EasterDate - Evaluating the Easter date for a given year
|
Total Hit (2781) |
«Code LangId=2»' Evaluate the Easter date for a given year
' Example: MessageBox.Show(EasterDate(2003).ToLongDateString())
Function EasterDate(ByVal year As Integer) As DateTime
Dim g, c, h, i, j, l, month, day As Integer
g = year Mod 19
c = year \ 100
h = ((c - (c \ 4) -
....Read More |
Rating
|
|
|
|
ArrayAny - Return an initialized array of any type
|
Total Hit (2111) |
«Code LangId=1»
' Returns an array and initializes it with passed data.
'
' It is similar to the Array function, but it works with
' array of any type. The type of the returned array is
' assumed to be the type of the first element in the
' parameter list, so you might need to force a given
....Read More |
Rating
|
|
|
ArrayAvg - The average of an array of any type
|
Total Hit (2157) |
«Code LangId=1»
' The average of an array of any type
'
' FIRST and LAST indicate which portion of the array
' should be considered; they default to the first
' and last element, respectively
' if IGNOREEMPTY argument is True or omitted,
' Empty values aren't accounted for
Function ArrayA
....Read More |
Rating
|
|
|
|
|
ArrayShuffle - Randomize the order of elements in an array
|
Total Hit (3493) |
«Code LangId=1»
' Shuffle the elements of an array of any type
' (it doesn't work with arrays of objects or UDT)
Sub ArrayShuffle(arr As Variant)
Dim index As Long
Dim newIndex As Long
Dim firstIndex As Long
Dim itemCount As Long
Dim tmpValue As Variant
firs
....Read More |
Rating
|
|
|
ArrayStdDev - The standard deviation of a numeric array
|
Total Hit (3235) |
«Code LangId=1»' The standard deviation of an array of any type
'
' if the second argument is True or omitted,
' it evaluates the standard deviation of a sample,
' if it is False it evaluates the standard deviation of a population
'
' if the third argument is True or omitted, Empty values are
....Read More |
Rating
|
|
|
ArraySum - The sum of all the items in an array of any type
|
Total Hit (2476) |
«Code LangId=1»
' Return the sum of the values in an array of any type
' (for string arrays, it concatenates all its elements)
'
' FIRST and LAST indicate which portion of the array
' should be considered; they default to the first
' and last element, respectively
Function ArraySum(arr As
....Read More |
Rating
|
|
|
|
|
|
BinarySearch - Fast search in a sorted array
|
Total Hit (3455) |
«Code LangId=2»
' Binary search in an array of any type
' Returns the index of the matching item, or -1 if the search fails
'
' The arrays *must* be sorted, in ascending or descending
' order (the routines finds out the sort direction).
' LASTEL is the index of the last item to be searched, a
....Read More |
Rating
|
|