Results 1 to 7 of 7
  1. #1
    benzylamine is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    4

    how to use present date as start date in access?

    hello experts,

    i have a problem with my query. i created a query that contains employee codes in the first column and transaction dates in the header with hour worked for each employee each day. for example.

    20150101 20150203 20150303 ........ 20150518 TOTAL
    A110 5HR 3HR ....... 400HR
    B110 5HR 3HR ....... 400HR


    C110 5HR 3HR ....... ...... 400HR

    how can i show all the record that is BETWEEN 300HR AND 400HR including the date? thank you. i am stuck for all day about this problem. thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    This is a CROSSTAB query?

    What is wrong with it? Why is it not giving you what you want?

    Show example of desired output.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    benzylamine is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    4
    Quote Originally Posted by June7 View Post
    This is a CROSSTAB query?

    What is wrong with it? Why is it not giving you what you want?

    Show example of desired output.
    Click image for larger version. 

Name:	D95A4F18-CB54-4CAB-9457-5DF51BC872FA.png 
Views:	13 
Size:	20.6 KB 
ID:	20794


    because A110 has worked for total 400 hours, i want to get the last 200 hours record like pic showed above. thank you.

  4. #4
    benzylamine is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    4
    anyone know? I was so confused. thank you.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Not understanding. If there is data for 20150101 and 20150202, why do you not want to display it under those columns? If you don't want 01 and 02 data then apply filter criteria to exclude them. There will then not be any columns for those months.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    benzylamine is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    4
    Quote Originally Posted by June7 View Post
    Not understanding. If there is data for 20150101 and 20150202, why do you not want to display it under those columns? If you don't want 01 and 02 data then apply filter criteria to exclude them. There will then not be any columns for those months.
    because I want to get record 200 hours preceding "20150404". I do not know when it will reach 200 hours. the above data is just an example. is there any function such as iif hours reach 200 from "20150404", it will show all the record? thank you.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You want only the most recent records and only those that add up to 200 hours? No, there is no simple way to accomplish. Will probably involve a running sum in query and then criteria to pull records where the running sum is less than 200. Running sum in query is not easy. Search forum and web on the topic. Here is one https://support.microsoft.com/en-us/kb/290136
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 10-27-2014, 04:54 PM
  2. Replies: 15
    Last Post: 04-06-2012, 10:57 AM
  3. Replies: 1
    Last Post: 07-07-2010, 04:22 PM
  4. Replies: 2
    Last Post: 07-31-2009, 06:56 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