It's a number of years since I have used Access and I'm creating an asset database using Access 2016 and need to send an automated email with a report that will show assets that are due to be refreshed in the next year, six months, 3 months, then 2 months then 1 month. The report does have a date field called refresh date.
I have see details on how to send an email from access but I cannot find how to automatically run the report and for it to search by the date field?
Any help would be appreciated
Thanks
One solution would be to launch your access application from the Task Scheduler. That way you can setup in detail when to launch the application. Then within the application you can produce the report based on the current date.
You need to:
-Setup Task Scheduler to launch the application at the desired times.
-Set macro Autorun to launch a VBA script.
-The VBA script checks if the given conditions are true. If so it produces the report, exports it as a PDF file and makes the email with the file file.
Please specify your question more in case you need further help on "and for it to search by the date field?".
You could set a timer on the form that checks if Now() = date on the form + X number of days (30, 60, 90, 180, 365) and if it hits one of them it sends the appropriate email.
If the DB is open all the time have it run once a day (timer interval of 86400000 ms).
If it is going to be open but not all the time have the interval set to a lower amount.
Related
Context: I am using Microsoft Dynamics (CRM) and Eloqua to send email campaigns. I have a date field in CRM that I want to check against in Eloqua for a specific campaign. This campaign needs to check to see if the date field is <= today's date + 90 days. I am using the campaign UI in Eloqua, not doing anything programmatically at this point.
I have tried using the Compare Custom Object Fields decision in Eloqua by finding the date field, setting the comparator to dynamically on or before, and I want to make the compared value Today + 90 days. I'm not sure how to accomplish this in this type of Decision object because the only options I have to compare the date field to are Yesterday, Today, or Tomorrow. See image below:
I have also tried to use the Compare Date Decision object, but there is no dynamic comparison, just hard-coded date options.
The last thing I tried was a Wait step, but that only waits a hard-coded number of days rather than checking dynamically.
Has anyone run into this issue or know of a solution to this problem?
We were able to find an Eloqua Date App to download that adds a Date Decision step to the program builder which allowed us more flexibility with comparing dates in a custom range.
I have 25 countries data file has week wise data in CSV format which we get every Monday in ftp location, I just need to consolidate all the files into one file which I am able to do.
In each data file there is "Week" column and now I need to check whether latest week data is there in file or not , if not there send the mail saying file does not have latest data.
For example next Monday is on 16th March so max week in file should be 9th March.
How can I apply that logic?
Using tAggregateRow and tJavaRow I am able to get the max week of each file but how to design job after that?
The basic steps you want to follow are:
Keep the expected max date in a global variable at the start of
job. In this example it should be 9th March.
Read each file one by one and get the max of week date and if it
matches the global variable then do not send email. Otherwise send
the email.
So an example job flow might look like:
tFileList---iterate--->tFileInputDelimited--->tAggregaterow--->tJavaRow---RUN IF condition(based on if SendEmailflag is Y)--->tSendMail
The tAggregateRow should get the max week date.
In the tJavaRow you should compare if input_row.maxdate == globalmaxdate(9-march) and based on this set another flag SendEmailFlag=Y or N with it defaulting to N.
I would like to know how to pre-fill the Scheduling Start and End Date in the metadata/properties of each item edited or created in a SharePoint list.
Scheduling Start Date: Today's date.
Scheduling Start Date: Today's date + one year.
Reason for ask: I configured the list items to expire and move into "draft" status when they hit their specified Scheduling End date, therefore un-publishing the item from external view.
Problem: Users/contributors are creating these items and are not entering enough time for it expire. What I'd like to do is automatically pre-fill the scheduling end dates for one year out from today's date when an item is edited or created.
Background info: I've enabled scheduling of items in a list (via "Enabling scheduling of items in this list" option in "Manage item scheduling" in Library Settings). I currently have a workflow and versioning enabled so that the admins check the content before it's view-able externally.
Your thoughts are appreciated.
This is pretty easy using Calculated Field Formulas in the default value fields of your two columns. Here and here are discussions on the basics of setting a default value for a date field, but it's pretty straightforward.
For Scheduling Start Date, set the default value to Today's Date. For Scheduling End Date, use the calculated value of =DATE(YEAR(Today)+1,MONTH(Today),DAY(Today)) for the default value.
I need to have a user enter a start Year for a report that will show 10 years of stats beginning from that start year.
I have a parameter where the user inserts the year (ie 2000) as the start year, but the parameter is just recognized as a number not as part of a date or year. Which I thought was fine (I have everything I want working in the report for the first year. Now that I want to go an add a section that takes the parameter and adds one, I'm having trouble.
DateAdd seems to just work with dates and this parameter is passed as a number. I must really be missing something. Any advice would be greatly appreciated.
Try:
Year({table.dateField}) IN {?YearPrompt} TO ({?YearPrompt}+1)
Upon logging into their accounts, each user has their login date and time stored to the database. What I was looking to do however is figure out the amount of days (or preferably convert into months if greater than a month) so that if a user views their profile they can see how active the band are. Also, this could benefit me in terms of keeping active profiles top of the agenda for content on the site so that it doesn't become stale from inactive users content filling up main page content.
I'm using ColdFusion so i'd be looking for a way to find for example how many days ago #lastLogin# was from #now()#. So say if the date of the last login was 23/04/2013 and todays date is 29/04/2013 it would read "Last Active, 1 day ago." However if the last login was 23/03/2013, it would read "Last Active, 1 month ago".
Anybody know how to do this? Thanks.
P.S I currently have no code from testing this as I have no idea where to start in terms of achieving this.
Use DateDiff
<cfset days = dateDiff("d", LoginDateVariable, now()) />
It's as simple as that.
P.S I currently have no code from testing this as I have no idea where
to start in terms of achieving this.
This doesn't answer your direct question but to help you know where to get started, I would strongly suggest reviewing the built in ColdFusion functions and tags that are available to you.
Tags
Tags by function
Functions
Functions by category
Also, Google searches usually land you at the docs, just add "coldfusion" to your search string. Searching google for coldfusion date functions yields very helpful answers, the first of which are a list of all ColdFusion date functions.
Dale's answer is spot on. But I would also suggest returning it as a variable with your query. Let the SQL server do the work. It's very efficient for those types of calculations. Not that CF can't do them well, too. But it's probably more appropriate for SQL to do that lifting. Especially if you're already returning the lastLogin date.
It would be similar to the CF solution:
SELECT ...., lastLogin, DATEDIFF(d, lastLogin, GETDATE()) AS LastLoginDays
FROM ....
WHERE ....
That would give you the number of days. You'd have to decide how you wanted to define a month if you wanted to break it out by month/day. That would get a bit more complex. You could write a SQL function that could be run on both dates and give you an accurate count of days/months/years since last login.
One other thing to keep in mind: Where are the dates being generated? When you insert loginDate into the database, are you doing a now() in CF before you insert it or are you doing a getDate() in SQL when you insert it? Again, I would let the database do your date logic, but you'd want to compare the two dates from the same source. For instance, if your loginDate was a database getDate() then you may not want to compare that to a CF now(). One goes by the datetime of the SQL server and the other goes by the datetime of the CF server. They could be different.