Help With Date Range

Results 1 to 3 of 3

Thread: Help With Date Range

  1. #1
    Join Date
    Dec 1969

    Default Help With Date Range

    Hi,<BR><BR>I have the following code that blinks an icon next to any data that as been inserted today. This all works fine, no problem.<BR><BR>If rsDLinks("cDateEntered") = Date() Then<BR>"writes animated gif here"<BR><BR>How would i write the code to show any data in the past 48 hours or 2 days, what would I use instead of Date()?<BR><BR>Many Thanks<BR><BR>Darrell...

  2. #2
    Join Date
    Dec 1969

    Default RE: Help With Date Range

    If rsDLinks("cDateEntered") = dateAdd("d",-2, Date()) THEN<BR><BR>...I think

  3. #3
    Join Date
    Dec 1969

    Default What about future dates?

    Ehhh...never mind...let&#039;s do it carefully:<BR><BR>&#060;%<BR>dlinkDate = DateValue( rsDLinks("cDateEntered") )<BR>If dlinkDate &#062;= Date()-2 AND dlinkDate &#060;= Date() Then<BR> ... yep, within last 2 days ...<BR>End If<BR>%&#062;<BR><BR>Since you were using a comparison vs. DATE() in your original code, I would assume that the "cDateEntered" field has *just* a date and not a Date and Time? If so, you can&#039;t really do 48 hours, exactly, can you? If "cDateEntered" has both a date and time, ask again.<BR><BR>

Posting Permissions

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