Hi,
You can try them on the Immediate Debug Window. Cut and paste the next
indented line, one by one, into the Access Immediate (Debug) Window, and
make a return to see the result.
Debug.Print LCASE("Hello World")
should return the string into all Lower CASE characters.
Debug.Print Left("Hello World", 5)
should return the fifth first characters ( at the left of ) the string.
Debug.Print Mid("Hello World", 4, 5 )
should return 5 characters from the fourth one. If you do not supply the
third argument, the length of the result to be returned, the result goes "up
to" the end of the string:
Debug.Print Mid("Hello World", 4)
Debug.Print RIght("Hello World", 2)
should return the 2 last (rightmost) characters.
Debug.Print len("Hello world")
should return the number (len_gth) in the string.
Debug.Print len(RTrim("Hello world "))
should return the length of the string from which we have trimmed (removed)
the spaces at the Right.
Debug.Print "*" & Space(5) & "*"
should return five spaces embedded by a * at each end.
Debug.Print "*" & Trim( " Hello World ") & "*"
should show you that trim remove spaces at the left and at the right (but
not at the middle) of the string.
Debug.Print UCase("hello WoRlD")
should convert all character to upper case.
Debug.Print DateAdd("m", 2, Now( ) )
should show 2 months past now (we add 2 months to Now). See help file to
know how to add year, day, hour, minute, or second.)
Debug.Print DateDiff("m", #31-10-2004#, #11-1-2004# )
should give the number of different month change between the two given
dates. Here, 1, since we have change month one time from the 31 October to
the First of November. Again, see help file for other time interval.
Avg, Count, Max, Min and Sum are aggregate to be used in SQL, they operate
vertically, on one column. Sum( ColumnName ) would return the sum of the
values in the mentionned field name. Avg would average, Max would find the
maximum; Min, the minimum and Count( fieldName ) will count the number of
time a record has a not null value. Count(*) would count the number of
records.
Hoping it may help,
Vanderghast, Access MVP