Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Dates - Days and months switching around

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NateBuckley - 29 May 2008 06:14 GMT
Hello, I'm building a solution that is heavily dependant on dates, the
problem I'm having is in certain situations it's switching the day and month
around. I'm from the UK so we use dd/mm/yy - where as Americans use mm/dd/yy
so I'm guessing it's somehow reverting to American style in VBA somehow.

It's a little bit confusing as I do lots of date checks and sometimes it'll
work correctly and other, seemingly random times it'll switch around.

I'm just wondering if there is a way to specifically make sure - to force
the little swine - to treat all dates as declared as in my regional settings.

Any help given would be appreciated, otherwise I may have to take a
boomstick to the machine. :)

Nate
Bob Phillips - 29 May 2008 08:35 GMT
cast the date

CDate(Mydatevalue)

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> Hello, I'm building a solution that is heavily dependant on dates, the
> problem I'm having is in certain situations it's switching the day and
[quoted text clipped - 15 lines]
>
> Nate
NateBuckley - 29 May 2008 09:13 GMT
Cheers Mr.Phillips, I shall kick myself for not thinking of that and also
taking up your time, but thank you for your speedy reply.

> cast the date
>
[quoted text clipped - 19 lines]
> >
> > Nate
Bob Phillips - 29 May 2008 09:20 GMT
Being from the UK too, I suffer that VBA 'feature' all the time.

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> Cheers Mr.Phillips, I shall kick myself for not thinking of that and also
> taking up your time, but thank you for your speedy reply.
[quoted text clipped - 24 lines]
>> >
>> > Nate
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.