Results 1 to 3 of 3
  1. #1
    HMEpartsmanager is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    85

    Business Weekday?

    I made a report last week, and the goal was to get a query showing the past 3 workdays. An example would be for Friday; I want Friday/Thursday/Wednesday.



    For todya (Monday), I want to get Monday/Friday/Thursday. Which is the 3 'work days'. I though weekday would do it, but obviously I misunderstood the weekday, and workday. :-)

    So, is there a way to a business day?

    Here is what I had used, until today......

    >=DateAdd("w",-2,Date())

    So it gives the query extracted with today and the previous 2 days; but I really wanted to find a way to get just the (Monday through Friday) type of days.

    Anyone know a quick little fix for the above line?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    What about holidays etc, and are you just looking for a list of dates counting backward from whatever the current date is? Does this relate to a specific set of data, if so you can look at using the TOP command in your query. For instance if you're pulling data from a table you set an upper limit of the date to be today's date and sort it in descending order. For instance something like:

    Code:
    SELECT TOP 3 Orders.OrderDate
    FROM Orders
    GROUP BY Orders.OrderDate
    ORDER BY Orders.OrderDate DESC;

  3. #3
    HMEpartsmanager is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    85
    The owner of the company wanted to have a list of parts that have arrived in the past few days, so I created a report that I could e-mail to him a couple of times a day showing what 'has arrived'. This seemed to work fine for Wednesday, Thursday, and then Friday. Upon running it this morning, it only gave a list of today; no Friday or Thursday. That is when it dawned on me that WEEKDAY is generic in that it means a day of the week; not a business day that I had thought it meant.

    So that made me think to look for a business day function, but alas, it looks like one could be coded, but for our purposes, I think we can live with the 3 generic weekdays. I changed my query from Today - 2 days; to a Today - 3 Days, which will now give a Friday. It also gives him an extra day of what has arrived. This will work for this simple report.

    If I wanted anything more involved, I would just have to create the day of week function, but it is not needed for simple report. Monday's, he would get Monday and Friday; Tuesday he will get Tuesday/Monday; etc.... It is mostly to see what has arrived 'recently'; and this will be fine.


    Thank you,

    Tim

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

Similar Threads

  1. Help with Weekday Function
    By Juan4412 in forum Queries
    Replies: 3
    Last Post: 10-18-2011, 07:14 AM
  2. Weekday Name from a Date
    By Coors in forum Queries
    Replies: 9
    Last Post: 09-26-2011, 03:08 PM
  3. Convert date to weekday overview
    By LarsBoer in forum Forms
    Replies: 3
    Last Post: 09-14-2011, 07:25 AM
  4. Weekday excluding weekends
    By jd316632 in forum Queries
    Replies: 3
    Last Post: 05-24-2010, 02:01 PM
  5. Individual weekday count in a month
    By Silver_A in forum Queries
    Replies: 6
    Last Post: 04-16-2010, 08:14 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