From: Jerry Whittle on
If the date is in an actual date/time field, you could display is like you
wish in a query, form, or report with somehing like:

CLng([FieldName])

However you are going to run into problems with the DD-MM-YYYY date format.

debug.Print CLng(#13-05-2010#) = 40311 (13-May-2010)
debug.Print CLng(#12-05-2010#) = 40517 ( 5-Dec-2010)

Access assumes MM-DD-YYYY first and reverts to DD-MM-YYYY only after that
won't work. At least that what it does using the regional settings for the
USA.

You may need to deconstruct your date string and reconstruct it as
MM-DD-YYYY to make sure that it produces the proper date.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Marco" wrote:

> Hi. In excel if I type into a cell today's date 26-05-2010 and then if I
> format the cell as general, the value will be like this:
>
> 26-05-2010 » 40324
>
> How can I do this in access?
>
> Regards,
> Marco
From: Maarkr on
=CLng([DateField])

"Marco" wrote:

> Hi. In excel if I type into a cell today's date 26-05-2010 and then if I
> format the cell as general, the value will be like this:
>
> 26-05-2010 » 40324
>
> How can I do this in access?
>
> Regards,
> Marco