"Southern at Heart" <(E-Mail Removed)> wrote in
message news:E67D6548-98E2-4274-B774-(E-Mail Removed)...
> StrDate is assigned todays date with the Now function, the value looks
> like
> this:
> 3/25/2010 10:36:48 PM
>
> ...I need the value to look like this:
> 2010/03/25
> (the month and day have to be 2 digits)
>
> How do I do this?
> thanks.
Is StrDate a variable? if so, what type of variable is it? The prefix
"str" usually denotes a string, but sometimes prefixes can be misleading.
If you just want the date, and not the time, you can assign from the Date()
function, rather than Now() -- look in the online help for a comparison of
Date(), Time(), and Now().
Assuming StrDate is a string variable, then you need to format the date into
the desired string. Try this:
StrDate = Format(Date(), "yyyy/mm/dd")
--
Dirk Goldgar, MS Access MVP
Access tips:
www.datagnostics.com/tips.html
(please reply to the newsgroup)