Results 1 to 4 of 4

Thread: Date Functions

  1. #1
    Join Date
    Nov 2006
    Posts
    43

    Unanswered: Date Functions

    I've been having problems with my dates
    Could you please help with my date queries?

    Day functions are not working. "Pulling the correct information"

    Monday
    Date()-((((Weekday(Date()+2))+3)))

    Tuesday
    Date()-((Weekday(Date(),2))+5)

    Wednesday
    Date()-(Weekday(Date(),2)+4)

    Thursday
    Date()-(Weekday(Date()+2)+0)))

    Friday
    Date()-(Weekday(Date()+2)+6)

    Month to Date
    Format(Date(),"yyyymm")

    ----------------------------------------------------

    Other examples

    PreMonth
    (((DateDiff("m",[DateofPayment],Date()))=1))

    PreYear
    Expr1: DateDiff("yyyy",[DateofPayment],Date())

    Today
    DateAdd("d",0,Date())

    Year to Date
    Format(Date(),"yyyy")

    ONe Month Back
    (((DateDiff("m",[DateofPayment],Date()))=0))

    Two Months Back
    (((DateDiff("m",[DateofPayment],Date()))=1))

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    496
    Provided Answers: 24
    Date math is done with
    dateadd("d",4,date())

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Probably would help if you gave a clearer explanation of what your goals are...i.e. what Monday? The Monday of the current week? The Monday of last week? Monady of next week?

    Like that, for each day of the week.

    Same thing for PreMonth, PreYear, Today...etc.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Nov 2008
    Posts
    24

    Date functions

    I have attached a draft module of a number of date related functions I've collected over time.
    It has many functions you might find useful.
    This is not all of my own work and is available via many forums and authors.
    Attached Files Attached Files

Posting Permissions

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