+ Reply to Thread
Results 1 to 2 of 2

Issue with date format when comparing two date values (I'm in Australia)

  1. #1
    Registered User
    Join Date
    09-23-2013
    Location
    Gold Coast, Australia
    MS-Off Ver
    2010
    Posts
    50

    Issue with date format when comparing two date values (I'm in Australia)

    This one is killing me!

    I'm trying to compare two dates with the following code:

    Please Login or Register  to view this content.

    Cell R2 gets it's value from an earlier function:

    Please Login or Register  to view this content.

    The issue I am having is that although I format the dates to "dd mmmm", it appears that the default of the date within excel in the Now() command is in US format "mm dd yyyy".

    What I am finding is that when I compare a date with a "dd" value of 12 or less, it interprets that in the "mm dd yyyy" format. If the "dd" value is greater than 12, it interprets it in the "dd mm yyyy" format.

    The result is when I compare values as now, where yesterday was 07-11-2013 (Cell R2) & today is 08-11-2013 (dateCompare var) my code fails and tells me that dateCompare is NOT a later date than Cell R2.

    This is absolutely doing my head in as I'm right at the end of a massive project, and this is stopping it from being completed!

  2. #2
    Registered User
    Join Date
    09-23-2013
    Location
    Gold Coast, Australia
    MS-Off Ver
    2010
    Posts
    50

    Re: Issue with date format when comparing two date values (I'm in Australia)

    Please don't judge all Australians, but.......

    I declared the variables as STRING and not DATE

    I really want to give myself an uppercut right now......


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Date Picker Date Format issue
    By AndyE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-21-2012, 06:43 PM
  2. [SOLVED] Date Format Issue
    By eramosjr1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-07-2012, 11:02 AM
  3. [SOLVED] conditional format by comparing to current date
    By Kitfox in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-09-2005, 01:10 PM
  4. [SOLVED] How do I convert date values to non-date format e.g. 01-06-78?
    By mikelenno in forum Excel General
    Replies: 2
    Last Post: 07-08-2005, 04:05 PM
  5. Date Format Issue
    By tgilbreath in forum Excel General
    Replies: 2
    Last Post: 06-08-2005, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1