Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,
I have 3 columns:
Action Start Date, Planned Closure Date & Real Closure Date in my application called Employee Actions Manager developed by using VB.Net2010 & MS Access 2010.
I want to set a reminder that can remind me on 5th day after the Planned Closure Date for each action.
I want a reminder when I open my Application, I have all the records in data grid...can I highlight the record as a reminder???

What I already did added a query in the Action Log Table Adaptor under name (FillByPositive5DaysDelay) which is as follows:

SQL
SELECT        ID, ActionReferance, ActionDescription, ActionSite, ActionCategory, ActionImportance, ActionAccountability, ActionProgressStatus, ActionClosurestatus, ActionDoneBy, 
                         ActionComment, ActionYear, ActionStartDate, PlannedClosureDate, RealClosureDate
FROM            ActionsLog
WHERE        (PlannedClosureDate >= DATEADD(DD, + 5, GETDATE()))


But there is a SQL execution error (undefined function GETDATE in expression).So can you help me to avoid this error?

Please kindly note that I have added the following function in the Actions Log form but the same problem still persists.

VB
Private Sub GETDATE()
        System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
End Sub



Thanks in advance!!
Posted
Updated 13-Apr-15 9:36am
v3

Microsoft Access does not know what GETDATE() is. You can use NOW() in Access.
 
Share this answer
 
Comments
Sherif Adely 13-Apr-15 10:12am    
Thank you RyanDev for your prompt reply

Sorry I’m a beginner in VB and I have revised my code to

WHERE (PlannedClosureDate >= DATEADD(DD, + 5, NOW()))

But I have new error message (No value given for one or more required parameters) when I execute the query.
ZurdoDev 13-Apr-15 10:18am    
The plus is weird, but I don't know if that is it.
Sherif Adely 13-Apr-15 11:29am    
I removed the plus but I have the same error.
ZurdoDev 13-Apr-15 11:34am    
Just a suggestion, but it would probably be faster for you to google this.

See http://www.techonthenet.com/access/functions/date/dateadd.php

First parameter needs to be in quotes. And d is day, not DD in Access.
Sherif Adely 17-Apr-15 10:50am    
Thanks alot :)
A proper WHERE clause should look like:

SQL
WHERE (PlannedClosureDate >= DATEADD("d", 5, DATE()))


For further information, please see:
DATE function (MS Access)[^]
DATEADD function (MS Access)[^]
 
Share this answer
 
Comments
Sherif Adely 17-Apr-15 10:50am    
Thanks alot :)
Maciej Los 17-Apr-15 11:19am    
You're very welcome ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900