Results 1 to 3 of 3
  1. #1
    Lojik is offline Novice
    Windows Vista Access 2003
    Join Date
    Mar 2011
    Posts
    3

    Showing a specific forward date ?

    Hi guys,



    sorry my first post here and I cannot find what I need on the search so if this has been answered already then I apologize.

    background on project:
    I have designed a budget system for my self that imports all my transactions from the bank and then deducts any budgets I have allocated (e.g water, power, shopping etc)

    So far it has been working out great but I want to refine it a little to help with those days when I'm running paycheck to paycheck.

    Below is a photo of a query I use to calculate the cash currently assigned to budgets so I know how much "actual" cash I have to spend.

    currently the system calculates the exact money assigned up to todays date and deducts it from my balance.

    My Problem:

    Sorry if this sounds confusing but not sure how to explain what I want.

    What I want to do is have the system calculate the exact money assigned up to my next paycheck which is every Thursday instead of upto the current date which it currently does based on "date()"

    so instead of using date() is there a code to show the date on the next Thursday, e.g if I opened the program today (Fri 25th March) it would show Thurs 31st March. If I opened it on the Thurs 31st March it would show the Thurs 4th April, If I opened it on the Wed 3rd April it would show the Thurs 4th of April etc?



    Thanks for you time and help

    Kind Regards
    L
    Last edited by Lojik; 03-24-2011 at 07:39 PM.

  2. #2
    Lojik is offline Novice
    Windows Vista Access 2003
    Join Date
    Mar 2011
    Posts
    3
    Had a little brain storm after I wrote this, would the below work:

    Using a code to show the Physical Day, then a separate cell with an IIF query stating IF Thurs,+7,IF Friday,+6,IF Saturday,+5,IF Sunday,+4,IF Monday,+3,IF Tuesday,+2,+1

    Just not sure what code would be used to display the day name.

  3. #3
    Lojik is offline Novice
    Windows Vista Access 2003
    Join Date
    Mar 2011
    Posts
    3
    Solved

    I added two more columns in my query

    Code:
    DayName: Format([CurrentDate],"ddd")
    and
    Code:
    NextPayCheck: IIf([DayName]="Thu",[CurrentDate]+7,IIf([DayName]="Fri",[CurrentDate]+6,IIf([DayName]="Sat",[CurrentDate]+5,IIf([DayName]="Sun",[CurrentDate]+4,IIf([DayName]="Mon",[CurrentDate]+3,IIf([DayName]="Tue",[CurrentDate]+2,[CurrentDate]+1))))))
    Yay for persistance

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

Similar Threads

  1. Get the 0's gone and the -1's showing as 1
    By ARickert in forum Queries
    Replies: 5
    Last Post: 01-07-2011, 05:44 PM
  2. Replies: 2
    Last Post: 10-11-2010, 09:09 AM
  3. Replies: 3
    Last Post: 09-29-2009, 07:08 AM
  4. Showing date and time when importing to access
    By timpepu in forum Import/Export Data
    Replies: 0
    Last Post: 05-07-2009, 07:13 AM
  5. Automatic Data Entry on a Specific Date
    By alanbrai in forum Programming
    Replies: 2
    Last Post: 11-14-2007, 05:15 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