PC Review


Reply
Thread Tools Rate Thread

Dates - Days and months switching around

 
 
NateBuckley
Guest
Posts: n/a
 
      29th May 2008
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
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      29th May 2008
cast the date

CDate(Mydatevalue)

--
---
HTH

Bob


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



"NateBuckley" <(E-Mail Removed)> wrote in message
news:906C206A-0001-4704-BCA6-(E-Mail Removed)...
> 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



 
Reply With Quote
 
NateBuckley
Guest
Posts: n/a
 
      29th May 2008
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.



"Bob Phillips" wrote:

> cast the date
>
> CDate(Mydatevalue)
>
> --
> ---
> HTH
>
> Bob
>
>
> (there's no email, no snail mail, but somewhere should be gmail in my addy)
>
>
>
> "NateBuckley" <(E-Mail Removed)> wrote in message
> news:906C206A-0001-4704-BCA6-(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      29th May 2008
Being from the UK too, I suffer that VBA 'feature' all the time.

--
---
HTH

Bob


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



"NateBuckley" <(E-Mail Removed)> wrote in message
news:F3BE68DE-9ECE-40CB-8819-(E-Mail Removed)...
> 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.
>
>
>
> "Bob Phillips" wrote:
>
>> cast the date
>>
>> CDate(Mydatevalue)
>>
>> --
>> ---
>> HTH
>>
>> Bob
>>
>>
>> (there's no email, no snail mail, but somewhere should be gmail in my
>> addy)
>>
>>
>>
>> "NateBuckley" <(E-Mail Removed)> wrote in message
>> news:906C206A-0001-4704-BCA6-(E-Mail Removed)...
>> > 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

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of Months and Days between 2 dates? =?Utf-8?B?SmVhbg==?= Microsoft Excel Worksheet Functions 3 30th Mar 2007 04:49 PM
how many months and days between two dates? =?Utf-8?B?c2hvcGdpcmw=?= Microsoft Excel New Users 1 12th Feb 2006 08:08 AM
Dates to days/months/years Ian Microsoft Excel Misc 8 6th Nov 2004 06:41 PM
How do I calculate how many days in which months given two dates . =?Utf-8?B?TmljayBSb2dlcnM=?= Microsoft Excel Programming 1 3rd Nov 2004 03:29 PM
No of months and days between 2 dates Lance Microsoft Access Queries 2 1st Nov 2004 10:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:53 AM.