store month only

wazz

Super Moderator
Local time
Today, 16:16
Joined
Jun 29, 2004
Messages
1,702
if you are asked to store only the month, or only the month and year, how do you do it? tnx.
 
Format (now(), "mm") returns the month, format (now(), "mmyy") returns month/year. You could then store the results as either text or numeric Fields
 
Use the date functions; you can use

Month(YourDate)
MonthName(YourDate)
Year(YourDate)

To get whatever you need.
 
wazz said:
if you are asked to store only the month, or only the month and year, how do you do it? tnx.

This really depends on what your needs are. You can restrict the display of any date value to show only month or month and year, but you will still be storing the full date. I would recommend this. However, if you want to just store the month or mth/year you would need to use a text field to do it. If you want to store month number and year you could do it in either a text ro numberfield. For numeric fields I'd use a Long integer field and set the format to:

yyyymm
 

Users who are viewing this thread

Back
Top Bottom