Results 1 to 7 of 7

Thread: [2005] Getting rid of a repeat?

Hybrid View

  1. #1
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [2005] Getting rid of a repeat?

    your diagnose of the problem is spot on... the problem arises because NOW() includes the time, down to the milisecond.... what you should be comparing is the date portion. Because even if you set it to a date, it won't have the time, so it assumes midnight, which is less than Now() (which is the current date time) and you get the message.

    try this:
    VB Code:
    1. If Ffrom.Value < System.Data.Date.Today Then

    I think that's the right namespace path.....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  2. #2

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    32

    Re: [2005] Getting rid of a repeat?

    Quote Originally Posted by techgnome
    your diagnose of the problem is spot on... the problem arises because NOW() includes the time, down to the milisecond.... what you should be comparing is the date portion. Because even if you set it to a date, it won't have the time, so it assumes midnight, which is less than Now() (which is the current date time) and you get the message.

    try this:
    VB Code:
    1. If Ffrom.Value < System.Data.Date.Today Then

    I think that's the right namespace path.....

    -tg
    It says 'Date' is not a member of 'Data'. and it doesn't solve it. Thanks for trying though. After reading your post i tried,
    VB Code:
    1. now.date()
    and this still doesn't solve it.

    Thanks,

    Mutasim
    dim Mutasim as vbnewbie = stupid

    hehe!



Posting Permissions

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



Click Here to Expand Forum to Full Width