Formatting Period

  • Thread starter Thread starter Krish
  • Start date Start date
K

Krish

In a query, using a table attached to the database, I want to convert the
Period stored in the format such as mm/yy.
e.g.99-01,99-02....04-03,04-04,04-05. to mm/yyyy. When I build in the query
builder using Format([Period],"yyyy/mm"), the results come out as 1989/01,
1989/02 etc. How do I get the correct information?
 
If Period is a date field, then

Format([Period],"yy\-mm")

If Period is a text field, then

Right([Period],2) & "-" & Left([Period],2)
 
Krish -

When you're defining a format for a date, the letters m, d, and y represent
where you want the month, day and year, respectively.

The format you have listed is "yyyy/mm" - hence you are getting year, then
date. If you use "mm/yyyy" you will get month, then year.

If you want a different devider between month and year, use that character
in your format, such as "mm-yyyy."


Hope that solves your problem.

Amanda
 
Back
Top