I am trying to pull dates that are greater than the user entered date. We have a set table that contains budgeted hours. These hours are summed monthly, and are entered from July2012 to December 2013. I am trying to find a way that will show the sum of the hours after the user entered date. For example, if the user enters 9/30/2012, I want to show the sum of all hours from October 2012 to December 2013. My table structure is below:
Employee |
text |
Yr |
Number (2013) |
Mo |
Text (January) |
MonthHrs |
Number |
MonthYr |
Text (January2013) |
MoNumber |
Number (1) |
MoYrNumber |
Number (12013) |
I have created a query that is supposed to pull all records that are greater than the current MoYrNumber. MoYrNumber is made up of the month integer (1 for January, 2013 to indicate the year). However, this only pulls the records greater than that month. For example, when I enter 9/30/2012, the MoYrNumber is 92012, and the following records are retrieved: 102012, 112012, 122012, 92013, 102013, 112013, 122013.
How can I adjust the query so that the MoYrNumber will pull all of the records that are greater than the user entered number? (entering 9/30/2012 will open 102012, 112012, 122012, 12013, 22013, 32013,..... 122013?)
My query is below:
Code:
SELECT Budget.MonthHrs, Budget.Resource, Budget.moyrnumber
FROM Budget
WHERE (((Budget.moyrnumber)>(Month(CVDate(([Forms]![Form1]![PeriodTextBox].[Value]))) & (Year(CVDate(([Forms]![Form1]![PeriodTextBox].[Value])))))));
Thank you for your help