+ Reply to Thread
Results 1 to 2 of 2

comparison of date and time

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    toronto
    MS-Off Ver
    Excel 2003
    Posts
    58

    comparison of date and time

    Date data type in general consists of a date portion and a time portion

    What if I try to compare A & B, where both are of type date but B=time (which only gives the system time without a date portion)

    How does excel evaluate a comparison like that? Does it default the date portion of B as the current date first before it tries to evaluate ?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: comparison of date and time

    Read this...
    How Excel Stores Dates And Times

    It's a numeric comparison. A Time-only value has zero as a date.

    If you put a Date-Time value in a cell and change the cell format to number, you can see the numeric value for that Date-Time.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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/Time Comparison
    By High_Road in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-16-2013, 09:22 AM
  2. [SOLVED] Comparison of date and time
    By swati singh in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-15-2012, 06:03 AM
  3. Date/Time Comparison
    By mauddib13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-08-2008, 09:30 AM
  4. [SOLVED] Time comparison
    By Gixxer_J_97 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2005, 12:05 PM
  5. [SOLVED] Time/Data Comparison
    By SharonP in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-03-2005, 02:06 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