Results 1 to 2 of 2
  1. #1
    webisti is offline The Wisher
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    115

    Dateserial and datetime

    Hi
    I do have a query with with these two colums:
    MAILSent that is giving a dd/mm/yyyy hh/mm/ss result and another column with Followupdate with a format dd/mm/yyyy


    In a third column I do want to add expedited and I am using the formula :
    EXPEDITED: IIf([MAILSENT] Between DateSerial(Year(Date()),Month(Date())-1,1) And DateSerial(Year(Date()),Month(Date()),0) Or [FOLLOWUPDATE] Between DateSerial(Year(Date()),Month(Date())-1,1) And DateSerial(Year(Date()),Month(Date()),0),"X","")
    The results are not including all reccords especially from the mailsent, I am doing smth wrong but cannot come to what?

    Any ideas?

    Thanks

    Webisti

  2. #2
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    As long as the zero month in January doesn't cause problems, that should get you an "X" in all records where the [MAILSENT] and [FOLLOWUPDATE] fields are present and have values in the prior month. The problems I'd look for are (1) NULL dates in those fields (2) MAILSENT dates on the last day of the month - I bet MAILSENT is a timestamp, so verify that the value of DateSerial(Year(Date()),Month(Date()),0) gets you the END of the day on the monthend, not the beginning of the day.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Problem with a DateSerial Function
    By razkowski in forum Queries
    Replies: 1
    Last Post: 01-31-2013, 04:47 PM
  2. DateSerial Format
    By venu_resoju in forum Reports
    Replies: 4
    Last Post: 01-19-2013, 02:20 AM
  3. Replies: 2
    Last Post: 08-07-2012, 02:02 PM
  4. DateTime Difference Query help?
    By Astron2012 in forum Queries
    Replies: 6
    Last Post: 04-27-2012, 10:24 PM
  5. HELP with NULL DateTime VALUES
    By lfolger in forum Programming
    Replies: 3
    Last Post: 03-28-2008, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums