date formats

J

judith

Hi

Is it possible to format a date in a report with 1st, 2nd
etc.

Also how do I get the Format function to work in Access
2000. It doesn't seem to appear, is it an add-in?

Thanks
 
A

Allen Browne

If the Format() function does not work, you probably have a references
issue:
http://users.bigpond.net.au/abrowne1/ser-38.html

Rather than use the function, you may like to use the Format property of the
text box on the report.

The Long Date format does not include the "1st, 2nd", so you would be
looking at your own function to achieve that.
 
J

judith

If I use the format property how do i set a custom format
to produce 1st, 2nd etc.

The only way I can see is to pre test for a 1 and
concatenate in "st", 2 and concatenate in "nd" ... etc
but this seems rather clunky!
 
A

Allen Browne

Yes, you will need to write a function with a Select Case to test the last
digit for 1, 2, or 3 to determine the suffix to use. You will also need to
test if the tens digit is a 1: we use 11th, 12th, 13th, not 11st, 12nd,
13rd.
 
J

judith

thanks for your help
-----Original Message-----
Yes, you will need to write a function with a Select Case to test the last
digit for 1, 2, or 3 to determine the suffix to use. You will also need to
test if the tens digit is a 1: we use 11th, 12th, 13th, not 11st, 12nd,
13rd.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to the newsgroup. (Email address has spurious "_SpamTrap")




.
 

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