Formats for Custom Text Fields

N

Nick Pomponio

I am trying to create a formula in a custom Text field (Text1) that uses the
Format function. The Help for Formulas gives me this info:

Format( expression[, format[, firstdayofweek[, firstweekofyear]]] )

expression Required; any valid expression.
format Optional; a valid named or user-defined format expression.
firstdayofweek Optional; a Constant that specifies the first day of the
week.
firstweekofyear Optional; a Constant that specifies the first week of
the year.

I need the specifications for the "format" parameter. What are the allowable
format codes that I have available? Through trial and error, I can see that
MM and DD are two-digit month and day. I have searched the local and online
help, as well as the newsgroups and some MS-Project-related sites, but I
have come up empty-handed. Is there a definitive reference for the
"user-defined format expression" anywhere?

Thanks,
-Nick
 
J

Jim Aksel

In project hit F11 (opens VB Editor), Press F2 (opens object browser), search
on Format. I found Data Format and here are some of the options:


Constant Date format applied to 9/30/02 (12:33 PM)
pjDateDefault The default format, as specified on the View tab of the
Options dialog box.
pjDate_mm_dd_yy_hh_mmAM 9/30/02 12:33 PM
pjDate_mm_dd_yy 9/30/02
pjDate_mm_dd_yyyy 9/30/2002
pjDate_mmmm_dd_yyyy_hh_mmAM September 30, 2002 12:33 PM
pjDate_mmmm_dd_yyyy September 30, 2002
pjDate_mmm_dd_hh_mmAM Sep 30 12:33 PM
pjDate_mmm_dd_yyy Sep 30, '02
pjDate_mmmm_dd September 30
pjDate_mmm_dd Sep 30
pjDate_ddd_mm_dd_yy_hh_mmAM Mon 9/30/02 12:33 PM
pjDate_ddd_mm_dd_yy Mon 9/30/02
pjDate_ddd_mmm_dd_yyy Mon Sep 30, '02
pjDate_ddd_hh_mmAM Mon 12:33 PM
pjDate_mm_dd 9/30
pjDate_dd 30
pjDate_hh_mmAM 12:33 PM
pjDate_ddd_mmm_dd Mon Sep 30
pjDate_ddd_mm_dd Mon 9/30
pjDate_ddd_dd Mon 30
pjDate_Www_dd W40/1
pjDate_Www_dd_yy_hh_mmAM W40/1/02 12:33 PM

each of these has an integer associated with it as well, so they can also be
referenced that way.
--
If this post was helpful, please consider rating it.

Jim

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project
 
J

Jim Aksel

I'll bet if you try ALT+F11 instead of just F11 like I originally typed ....
you'd have much better results :) Brain moves faster than fingers....
--
 
N

Nick Pomponio

Jim,

Thanks so much for your help. I would not have thought of going to VBA to
peruse the contants for that version of the format function.

I'm somewhat surprised that there is no decisive source of info for the
format parameter. I have used similar formatting specs in Excel and Word,
both of which seem to be adequately documented.

Thanks again,
-Nick

Jim Aksel said:
In project hit F11 (opens VB Editor), Press F2 (opens object browser),
search
on Format. I found Data Format and here are some of the options:


Constant Date format applied to 9/30/02 (12:33 PM)
pjDateDefault The default format, as specified on the View tab of the
Options dialog box.
pjDate_mm_dd_yy_hh_mmAM 9/30/02 12:33 PM
pjDate_mm_dd_yy 9/30/02
pjDate_mm_dd_yyyy 9/30/2002
pjDate_mmmm_dd_yyyy_hh_mmAM September 30, 2002 12:33 PM
pjDate_mmmm_dd_yyyy September 30, 2002
pjDate_mmm_dd_hh_mmAM Sep 30 12:33 PM
pjDate_mmm_dd_yyy Sep 30, '02
pjDate_mmmm_dd September 30
pjDate_mmm_dd Sep 30
pjDate_ddd_mm_dd_yy_hh_mmAM Mon 9/30/02 12:33 PM
pjDate_ddd_mm_dd_yy Mon 9/30/02
pjDate_ddd_mmm_dd_yyy Mon Sep 30, '02
pjDate_ddd_hh_mmAM Mon 12:33 PM
pjDate_mm_dd 9/30
pjDate_dd 30
pjDate_hh_mmAM 12:33 PM
pjDate_ddd_mmm_dd Mon Sep 30
pjDate_ddd_mm_dd Mon 9/30
pjDate_ddd_dd Mon 30
pjDate_Www_dd W40/1
pjDate_Www_dd_yy_hh_mmAM W40/1/02 12:33 PM

each of these has an integer associated with it as well, so they can also
be
referenced that way.
--
If this post was helpful, please consider rating it.

Jim

Visit http://project.mvps.org/ for FAQs and more information
about Microsoft Project



Nick Pomponio said:
I am trying to create a formula in a custom Text field (Text1) that uses
the
Format function. The Help for Formulas gives me this info:

Format( expression[, format[, firstdayofweek[, firstweekofyear]]] )

expression Required; any valid expression.
format Optional; a valid named or user-defined format expression.
firstdayofweek Optional; a Constant that specifies the first day of
the
week.
firstweekofyear Optional; a Constant that specifies the first week
of
the year.

I need the specifications for the "format" parameter. What are the
allowable
format codes that I have available? Through trial and error, I can see
that
MM and DD are two-digit month and day. I have searched the local and
online
help, as well as the newsgroups and some MS-Project-related sites, but I
have come up empty-handed. Is there a definitive reference for the
"user-defined format expression" anywhere?

Thanks,
-Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top