Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date Specific Reporting (97 SR2)

    How would I generate a query (generally run on thrusday) to display data from the previous wednesday to the next wednesday? Does that make sense? It reflects the last week, but only from last wednesday to this wednesday...

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Date Specific Reporting (97 SR2)

    Have them enter one of the two dates as a parameter. That way, even if you run the report on a Friday or on the following Tuesday, you'll get the same results. Then use the DateAdd function to calculate the other date ( you can subtract with DateAdd too), and use Between in the criteria expression. Here's an example for a week interval:

    Between CDate([Enter beginning date]) and DateAdd("ww",1,[Enter beginning date])
    Charlotte

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Specific Reporting (97 SR2)

    The user will be holding meetings on the result every Friday, so it has to be for the week between wednesday's automatically. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15> How might I do that?

    (It would be easier if I could do that, but these big-wigs would just as soon not enter a date...)

    Thanks Millions Charlotte!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Date Specific Reporting (97 SR2)

    You'd need code to determine the day of the current date. There's a Weekday function that will give you that.

    Then you can use the DateAdd function to calculate the ending date by subtracting the daynumber from vbWednesday (which is 4, BTW). So if you run the report on Friday (vbFriday = 6), the difference would be vbWednesday - vbFriday, or -2.

    DateAdd("d", intDaysFromWednesday, Date) will return the date for Wednesday based on the current date. After that, you can use the "ww" weekday string with DateAdd to calculate the previous Wednesday date.

    You'll also need to code to trap days less than Wednesday, i.e., the following Monday, and to handle the calculation accordingly.
    Charlotte

Posting Permissions

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