home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 8,842 of 10,840   
   DavidB to Craig   
   Re: Date comparison   
   02 Oct 04 21:05:28   
   
   From: padabe@bellsouth.net   
      
   Craig, what are you trying to accomplish with the Date code?   
      
   As the others said, the code is not lying; the enddate is greater, by the   
   difference you came up with, then the startdate, but depending upon what you   
   are trying to accomplish, there are various ways to compensate for the   
   results.   
      
   "Craig"  wrote in message   
   news:48c681cb.0409140150.a600c63@posting.google.com...   
   > Hello everyone,   
   >   
   > I've got a an issue with comparing dates in VB6 (sp4) and I would   
   > greatly appreciate help that anyone has to offer on this subject...   
   > :-)   
   >   
   > I have two variables (start_DateTime and end_DateTime). Both contain   
   > the following date information (this is what is printed in the   
   > 'immediate' window when I execute the following code)...   
   >   
   > ?start_DateTime = 15/09/04 02:00:00   
   > ?end_DateTime = 15/09/04 02:00:00   
   >   
   > However, when I compare them both to see if there is a difference the   
   > following statement returns true(it thinks end_DateTime >   
   > start_DateTime)...   
   >   
   > If (start_DateTime < end_DateTime) Then   
   >           Do X   
   >           Do Y   
   >           Do Z   
   > End If   
   >   
   > However if I type the following...   
   >   
   > ?cdate("15/09/04 02:00:00") > cdate("15/09/04 02:00:00")   
   >   
   > It returns...   
   > False   
   >   
   > Why is this happening? I do not understand; I can only assume that   
   > there more information being held in the date data type than what I am   
   > seeing.   
   >   
   > Any help regarding this issue will be very much appreciated. Thank you   
   > in advance.   
   >   
   > SideNote:   
   >   
   > I'm not sure if this will help, but if I type   
   >   
   > ?end_DateTime - start_DateTime   
   >   
   > I get the following result...   
   >   
   > 7.27595761418343E-12   
   >   
   > Regards,   
   >   
   > Craig.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca