Format date question

  • Thread starter Thread starter Mikael Lindqvist
  • Start date Start date
M

Mikael Lindqvist

Hi everyone,

I have a textfield that I want to change (with a query) to "yymm".

Format([Datefield];"yyyymm")

is working, but not

Format([Datefield];"yymm")

Which really puzzles me..

It doesn't matter if the the new field is "date" or "text" as long as it
displays yy (2 digits) and mm (2 digits).

Any ideas?

Kindly
Mikael
Sweden
 
What version of Access?
I just tested with 2003 (US) and it returned 0801 for the current date

A workaround might be to use
Right(Format([Datefield];"yyyymm");4)

AHHH! A **TEXT** field. In that case, the format function may be having
trouble converting. Can you convert the text field to a datetime type
first?

I just tested a text string and it did convert correctly for me if the text
was delimited with dashes or slashes. However, with periods it did not
convert as desired.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Hi everyone,

I have a textfield that I want to change (with a query) to "yymm".

What's in the textfield now? Without knowing where we're starting, it's a bit
hard to tell you how to go!

John W. Vinson [MVP]
 
Back
Top