Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 44
  1. #16
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410
    It appears you have an old copy.



    how weird.

    it should be just two tables.

    It should have been " MembershipStats.zip"
    Attached Files Attached Files

  2. #17
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    is it now in 2013 format? I can't read it now.

  3. #18
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410
    Ok, try now.

    it was 2007-2010

    i saved it as 2003

    and i can still open it
    Attached Files Attached Files

  4. #19
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    nope still can't open it will have to wait until monday when I can get to a 2013 machine.

  5. #20
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    this is the criteria in your query 01_RegMembers:

    Code:
    Between DateAdd("yyyy",-1,DateSerial(Year(Date()),6,1)) And DateSerial(Year(Date()),6,1)
    You are taking 13 months of data rather than 12 months of data, you are going from 6/1 of the year prior to the current year through 6/1 of the current year which is not your stated intent.

    If you want the query to reflect payment dates from 7/1/2013 through 6/30/2014 your statement would be:

    Code:
    Between DateAdd("yyyy",-1,DateSerial(Year(Date()),7,1)) And DateSerial(Year(Date()),6,30)

  6. #21
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410
    Thank you!

    Will try that.

    But yet, it is for 13 months where the first month, July must include prior June + July and the last month is the current year's June.

  7. #22
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you are covering 13 months then you have to make a different column to separate the two junes


    Code:
    Jun: IIf(Sum(IIf(DatePart("m",[PaymentDate])=6,1,0))=0,Null,Sum(IIf(DatePart("m",[PaymentDate])>=6 And 7 Or DatePart("m",[PaymentDate])<=6,1,0)))
    this is your current calculation for June. There is nothing in this formula indicating year is important so you'd have to do something more like:

    Code:
    Jun: IIf(Sum(IIf(DatePart("m",[PaymentDate])=6 and datepart("yyyy", paymentdate) = datepart("yyyy", date()),1,0))=0,Null,Sum(IIf(DatePart("m",[PaymentDate])>=6 And 7 Or DatePart("m",[PaymentDate])<=6,1,0)))
    for the current year and use <> for the prior year.

  8. #23
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410
    Ok, looks like it's working. the Last column, current year's June is showing blank now.

    THANK YOU!

    Is the WHERE statement correct in limiting to 13 months of data? Right now it shows in the detail from 6/1/13 through 4/28/14.
    Code:
    Between DateAdd("yyyy",-1,DateSerial(Year(Date()),6,1)) And DateSerial(Year(Date()),6,1)

  9. #24
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410
    Ok, I am using the Jun and Jul: code provided in another query and I get Null for July and there's data for July 2013?

    Code:
    Jul: IIf(Sum(IIf(DatePart("m",[CreatedDate])=6 And DatePart("yyyy",[CreatedDate])=DatePart("yyyy",Date()),1,0))=0,Null,Sum(IIf(DatePart("m",[CreatedDate])>=6 And 7 Or DatePart("m",[CreatedDate])<=6,1,0)))
    I'm not sure what's going on?

    The old code
    Code:
    Jul: IIf(Sum(IIf(DatePart("m",[CreatedDate])>=6 And DatePart("m",[CreatedDate])<=7,1,0))=0,Null,Sum(IIf(DatePart("m",[CreatedDate])>=6 And DatePart("m",[CreatedDate])<=7,1,0)))
    shows totals for July.

  10. #25
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    As I said in my post

    Code:
    Between DateAdd("yyyy",-1,DateSerial(Year(Date()),6,1)) And DateSerial(Year(Date()),6,1)
    Is looking from 6/1/2013 through 6/1/2014 I don't think that's what you want, but that's your call if you're looking for a 13 months span ending on june 30 of the current year you've got to modify that second date.

    if you're trying to look at data from 6/1/2013 through 7/31/2014 that's different, the statement you have right now will work if and only if you never have any activity on june 1 of the current year.

    what query are you trying to adapt in post 24.

  11. #26
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410
    Yup, change it to:
    to capture 6/1/2013 through 6/30/2014
    Between DateAdd("yyyy",-1,DateSerial(Year(Date()),6,1)) And DateSerial(Year(Date()),6,30)
    06_SynchroTheaterOnIce.
    The table for this is not in the db. I was limited on what to make tables on due to the size limits of uploading files.

  12. #27
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    so you solved it? The july calcuation is exactly the same as the previous query you are just substituting one date for another, the calculation/formula do not change, though now that I'm looking at it a bit closer you will likely have to change the 'then' part of the immediate if to include the same year check as the condition of the immediate iff

    in other words

    Code:
    Jul: IIf(Sum(IIf(DatePart("m",[XX])>=6 And DatePart("m",[XX])<=7,1,0))=0 and datepart("yyyy", date()) = datepart("yyyy", [XX]),Null,Sum(IIf(DatePart("m",[XX])>=6 And DatePart("m",[XX])<=7 and datepart("yyyy", date()) = datepart("yyyy", [XX]),1,0)))
    Note I didn't check this to make sure it worked, just to give you an idea how to change the formula when you have overlapping months within a period (june 2013 and june 2014)

  13. #28
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410
    Ok I tried the code and replaced [xx] with PaymentDate and got an error.

    But YES, i need something to handle the "overlap" months from the prior year to current year.

    Last June and this june
    where last June + last July should report into the first column [Jul] and the last column [Jun] should be empty UNTIL June in the current year ... comes.

    Where I was showing data in the last column [Jun] in the 01_RegMembers query

    So from what I got first column [Jul] data is last year's Jun and last year's Jul
    Code:
    Jul: IIf(Sum(IIf(DatePart("m",[PaymentDate])=6 And DatePart("yyyy",[paymentdate])=DatePart("yyyy",Date()),1,0))=0,Null,Sum(IIf(DatePart("m",[PaymentDate])>=6 And 7 Or DatePart("m",[PaymentDate])<=6,1,0)))
    and the 2nd column [Aug] is:
    Code:
    Aug: IIf(Sum(IIf(DatePart("m",[paymentdate])>=6 And 7 And DatePart("m",[paymentdate])<=8,1,0))=0,Null,Sum(IIf(DatePart("m",[paymentdate])>=6 And 7 And DatePart("m",[paymentdate])<=8,1,0)))
    and all the other subsequent reporting months [Sep]-[Jun]

    with the last column [Jun], current year:
    Code:
    Jun: IIf(Sum(IIf(DatePart("m",[PaymentDate])=6,1,0))=0,Null,Sum(IIf(DatePart("m",[PaymentDate])>=6 And 7 Or DatePart("m",[PaymentDate])<=6,1,0)))
    WHERE:
    Code:
    Between DateAdd("yyyy",-1,DateSerial(Year(Date()),6,1)) And DateSerial(Year(Date()),6,30)

  14. #29
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Apr 2014
    Posts
    410
    How about this?
    Code:
    Jun: IIf(Sum(IIf(DateSerial(Year([PaymentDate]),6,1),1,0))=0,Null,Sum(IIf(DateSerial(Year([PaymentDate]-1),3,1) And DateSerial(Year([PaymentDate]-1),7,31) Or DateSerial(Year([PaymentDate]),6,30),1,0)))
    Where this is current year's Jun and totaling Jun (when it comes) + totals since last March through last Jul + all subsequent months since Jul?

    Though it won't allow me to add the BETWEEN nor the <= and >= for the range between last March and last July.
    So what is the best way to tell the year in each month's column's code?

  15. #30
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Code:
    Jul: IIf(Sum(IIf(DatePart("m",[PaymentDate])=6 And DatePart("yyyy",[paymentdate])=DatePart("yyyy",Date()),1,0))=0,Null,Sum(IIf(DatePart("m",[PaymentDate])>=6 And 7 Or DatePart("m",[PaymentDate])<=6,1,0)))
    This is your code to try to add june + july of the previous year into your july column as it stands now. You are only checking for june dates in the first part, and your check of the payment date in the second part are both wrong.

    Code:
    Jul: IIf(Sum(IIf(DatePart("m",[PaymentDate])=6 And DatePart("yyyy",[paymentdate])=DatePart("yyyy",Date()),1,0))=0,
    This is the first part of your statement. You are only checking june.
    it should be something more like:

    Code:
    Jul: IIf(Sum(IIf((DatePart("m",[PaymentDate])=6 OR datepart("m", [PaymentDate]) = 7) And DatePart("yyyy",[paymentdate])=(DatePart("yyyy",Date())-1),1,0))=0,
    Where you are checking to see if the month is 6 or 7 and the year is the PREVIOUS year.
    The formula within the FALSE part of your immediate if would follow the same formula, checking june and july of the PREVIOUS year.

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. rolling 12 month report
    By tngirl in forum Reports
    Replies: 7
    Last Post: 03-13-2014, 01:50 PM
  2. Date Range Query Only Returns Month and Day
    By hammer187 in forum Queries
    Replies: 5
    Last Post: 09-18-2012, 11:25 AM
  3. Replies: 4
    Last Post: 05-26-2012, 09:29 AM
  4. Rolling 12 or 6 Month Query
    By Shakenaw in forum Access
    Replies: 2
    Last Post: 09-22-2011, 09:24 AM
  5. Rolling 3 Month sums
    By michaeljohnh in forum Reports
    Replies: 1
    Last Post: 11-08-2010, 05:51 AM

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