ghange format

  • Thread starter Thread starter octet
  • Start date Start date
O

octet

I have a column in a query that represent days the field look like NYYYYYN
I would like to have the formatted to –MTWTF-
Can someone tell me how to do this?
 
I am sorry, but I don't understand what NYYYYN represents. I assume
that YYYY represents the year. Can you post an example of the data in
the field, the type of the data (is it a text field, a number field, or
a date field), and what that equates to?

For example, the solution if the field is a date field and you want the
name of the day would be

Format([DateField],"ddd") for three character day
Format([DateField],"dddd") for the full name of the day

If you want a one character day type then
Left(Format([DateField],"ddd"),1) (How you tell the difference between
Tuesday and Thursday could be a problem)

If you want the day of the week as a number
WeekDay([DateField]) will return 1 to 7.

Then you could combine that with Choose to return an abbrevation.

Choose(Weekday([DateField]),"Su","M","T","W","Th","F","Sa")

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
Hi John N = no Y = Yes
NYYYN = SMTWThFSa
N = Not open Y =Open the y are text fields
im trying to format it so it can be matched to a file that has the format
of -MTWRF- isn stead of NYYYYN

John Spencer said:
I am sorry, but I don't understand what NYYYYN represents. I assume
that YYYY represents the year. Can you post an example of the data in
the field, the type of the data (is it a text field, a number field, or
a date field), and what that equates to?

For example, the solution if the field is a date field and you want the
name of the day would be

Format([DateField],"ddd") for three character day
Format([DateField],"dddd") for the full name of the day

If you want a one character day type then
Left(Format([DateField],"ddd"),1) (How you tell the difference between
Tuesday and Thursday could be a problem)

If you want the day of the week as a number
WeekDay([DateField]) will return 1 to 7.

Then you could combine that with Choose to return an abbrevation.

Choose(Weekday([DateField]),"Su","M","T","W","Th","F","Sa")

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I have a column in a query that represent days the field look like NYYYYYN
I would like to have the formatted to –MTWTF-
Can someone tell me how to do this?
 
Back
Top