How can i write a funtion to determine if the Present year Inputed using the format "01/02/2016" (i.e, 01-Feb-2016) inputed into a textbox - The last year from a table in MS Access database, is greater than or equal to 3. And then transfer focus to
another form, representing another table in the database, if the value returns true
(i.e., if the result is greater than 3 or equal to 3), and says otherwise if the value is false (throws an error message.
I designed the project using VB.net 2010 and MS Access 2007
From your description, it is hard for me to understand your problem and what is your needs.
Would you please provide me with clear description about your problem or some code you have done.
Best regards
Cathy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Thank You Cathy. I am yet to write the code, as I am at a cross road on how to deal with datetime functions. but simply put it in these scenario:
For a staff to be promoted to the next level (Say from level 8 to level 9), he or she must have stayed up to 3 years in the present level, before he or she can be qualified for promotion to the next level), Which to say, if the year is 01/02/2017 (or any
date, within the year), all the staff being entered for promotion, must have been up to three years or more in the present level, before the said date being worked on (i.e 01/02/2017).
For your problem, I suggest you could use the system function DATEDIFF in Access.
e.g.
the staff ID is 123456,
SELECT IF(DATEDIFF("yyyy", [TheDateInCurrentLevel], DATE()) >= 3, 1, 0) AS [Result] FROM [StaffTable] WHERE [StaffId] = 123456
Best regards
Cathy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
None
0 Points
2 Posts
Present year - Last Year calculation
Feb 17, 2017 11:17 AM|okezievic2000|LINK
Star
8670 Points
2882 Posts
Re: Present year - Last Year calculation
Feb 20, 2017 05:37 AM|Cathy Zou|LINK
Hi okezievic2000,
From your description, it is hard for me to understand your problem and what is your needs.
Would you please provide me with clear description about your problem or some code you have done.
Best regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
None
0 Points
2 Posts
Re: Present year - Last Year calculation
Feb 20, 2017 09:24 AM|okezievic2000|LINK
Thank You Cathy. I am yet to write the code, as I am at a cross road on how to deal with datetime functions. but simply put it in these scenario:
For a staff to be promoted to the next level (Say from level 8 to level 9), he or she must have stayed up to 3 years in the present level, before he or she can be qualified for promotion to the next level), Which to say, if the year is 01/02/2017 (or any date, within the year), all the staff being entered for promotion, must have been up to three years or more in the present level, before the said date being worked on (i.e 01/02/2017).
Thank you
Star
8670 Points
2882 Posts
Re: Present year - Last Year calculation
Mar 07, 2017 09:16 AM|Cathy Zou|LINK
Hi okezievic2000,
For your problem, I suggest you could use the system function DATEDIFF in Access.
e.g.
the staff ID is 123456,
Best regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.