Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 13th, 2003, 01:45 PM
Registered User
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sean_stonehart Send a message via Yahoo to sean_stonehart
Default DateDiff problem

I'm trying to compare 2 dates using DateDiff & it's just not cooperating. Both dates are type Date & what I'm using looks like:::

DateDiff(DateInterval.Day, OldReferDate, OldAccDate) > "0" ......

It was working before I changed how I obtained the dates

I'm trying to make sure the OldReferDate isn't prior to the OldAccDate by making sure they evaluate to greater than zero.

Any input is appreciated because right now I'm feeling



 
Old October 21st, 2003, 04:09 AM
Registered User
 
Join Date: Oct 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The speech marks around the "0" might be causing a problem, the DateDiff function will return a number, and you're comparing it with a string. (anything between "" is seen by VB.NET as TEXT not a NUMBER - you won't get an error because you don't have Option Strict on!)

Try taking off the speech marks

----------
NeoTech





Similar Threads
Thread Thread Starter Forum Replies Last Post
DateDiff zahyea .NET Framework 1.x 0 October 16th, 2007 04:38 AM
datediff ebburks Access 2 July 28th, 2006 06:58 PM
help with DateDiff isaac2004 Classic ASP Basics 9 January 16th, 2006 02:34 AM
Using DateDiff iancrabtree Access 2 November 27th, 2005 07:33 PM
DateDiff Weirdness SerranoG Access VBA 1 July 16th, 2004 12:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.