coupling is something I noticed. if you call *GetMonthName* and pass an arg for the month name, than another arg to abbreviate. The same effect could be obtained writing a formatting function, Format(GetMonthName(arg), "mmm") or even better as you suggest calling Date.
having the formatting within the function may be a short cut for now but I bet at sometime changes could be made introducing bugs.
its also pretty common trap to reimplement (usually poorly) functions that pre-exist.
Janitored by Arunbear - retitled from 'coupling', as per Monastery guidelines
| [reply] |
Well, this code has to be locale independent so I actually can sympathise with this approach. We normally deploy onto German Computers but we also end up on various others as well and the output has to be english regardless so I can see why he took this approach than figuring out how to override the users locale settings. (OTOH if you know an easy way to do it im all ears :-)
---
demerphq
First they ignore you, then they laugh at you, then they fight you, then you win.
-- Gandhi
Flux8
| [reply] |
(OTOH if you know an easy way to do it im all ears :-)
Maybe SetLocaleInfo() is of help?
| [reply] |
Dim dToday As Date
dToday = #10/28/2004#
MsgBox format(dToday#,"mmm")
(i.e. Use # rather than " to define your dates. It may be SQL I'm thinking of though... If you have a chance to test it, let me know :) ) | [reply] [d/l] |
Dim dToday As Date
dToday = #10/28/2004#
MsgBox format(dToday,"mmm")
| [reply] [d/l] |