Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    9

    Angry Unanswered: To find day of week based on a date

    I have a form which has a transaction date field, which gets input from the user. How do I find the day of week, for that particular transaction date? Eg. if I have input today's date then my the auto field in my form should hold Thursday.

    I know to do this for current date as DayofWeek(Now()).
    But how would I find this for a date say in 2001.

    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    try:

    DatePart(interval, date[,firstdayofweek[, firstweekofyear]])

    The interval argument has these settings:

    Setting Description
    yyyy Year
    q Quarter
    m Month
    y Day of year
    d Day
    w Weekday
    ww Week
    h Hour
    n Minute
    s Second

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: To find day of week based on a date

    Originally posted by sushri
    I have a form which has a transaction date field, which gets input from the user. How do I find the day of week, for that particular transaction date? Eg. if I have input today's date then my the auto field in my form should hold Thursday.

    I know to do this for current date as DayofWeek(Now()).
    But how would I find this for a date say in 2001.

    Thanks
    If you enter the date in a textBox on a form, so use something like that:

    myDay= Weekday(Cdate(Forms("myInputForm").myTextBoxName))

    OR

    myDay= Weekday(Cdate(Forms!myInputForm!myTextBoxName))

Posting Permissions

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