I am trying to create two fields in Microsoft Word. One that has a "created Date" (that I can manually enter) and the second that calculates the difference in days from created date to today's current day. It is to allow me to see how long an item has been worked on as I am using trying to build a schedule in word.
I am assuming a Macro needs to be created but I can't find any clear examples anywhere.
Thanks for your help
Related
I have an excel file that is I am greeting weekly and the file column is written as “day01” “day02” and so on. “01” represent the dates and I am only supposed to get that every week depending on what date our calendar is, for instance if today is 5/3/2020 than that means I only will get column “day01” and next week I am suppose to get “day02”. I am using an ssis package with nested for loop and for each loop container. How can I get only one week of data from excel every week depending on the date.
I am stuck I need help please it’s for my school project.
The excel file has the following column
-ID integer unique values)
“day01” (currency)
-“day02” (currency)
-“day03” (currency)
-“day04” ....
I want to get for each ID one week of data that is “day01” which “day01” must much with the calendar, and for next week the same thing.
If it is just for the school project, use variables. Make sure that the loop picks and extracts only the MAX day value (if they are consecutive and each week gets a day n+1 name). It will allow you to extract only the latest week of data (or manually specify which one week you want, for a one time load).
In the real project, I would rather pull all data from the Excel file into a staging table (especially important if the Excel is not auto generated and users have access to it), review and validate, and then take the last week (or any week you need) and work with it further..
So what I'm trying to do is generate a calendar report in Report Builder based on the start and end dates entered. Based on this, I want to use buttons below the calendar called "Previous Month" and "Next Month" that on-click, will go to the previous or next months' calendar based on the start and end dates entered. I've tried doing this with a sub-report (report calls itself with new parameter values), but after one button click back or forwards, it starts decrementing or incrementing by year instead of month. Is there any way to do this? I'm trying to make this previous month/next month toggle work like that of Micorsoft Outlook's Month View.
Thanks in advance!
According to MSDN, you are using incorrect syntax in your expressions, which makes me wonder how it's even working at all.
Your DateAdd should use the DateInterval enum, and I'm not sure why you even need to use DateSerial, but it should have its hard-coded parameters in double-quotes.
Seems to me that this expression should work for what you need:
=dateadd(DateInterval.Month,-1,Parameters!start_cymd.Value)
But that's assuming, as per your comment, that the users can only choose a full month's data, so the start_cymd parameter will always be the first of the month.
Getting the end date is trickier because different months have different end-dates. Here's an example from the same MSDN page:
=DateSerial(Year(Parameters!start_cymd.Value), Month(Parameters!start_cymd.Value), "1").AddDays(-1)
These should get the start and end date of the previous month. Reverse the math/logic to get the next month.
Currently we use an excel spreadsheet with 4 tabs (as tab for each team), each tab is a planner/diary that week, each day has 4 "slots" for jobs that are planned in.
The people type in the information for each job into one of the 4 slotsfor the day. Each slot contains information in different cells; Job No., Address, Duration, Notes, etc...
The issue/time consuming aspect of this method is when jobs have to be moved about between teams or moved to a different day it involves lots of copying, pasting and deleting.
What I am trying to achieve is some form of drag/drop interface (similar to the way the calendar in Outlook works), where the people who use the spreadsheet can input details for the job in a form and then have a drag an drop "tile" to be able to drag into one of the "slots.
The data contained in these slots needs to be able to produce a report which is a linear list of all the jobs planned that week.
I am at a loss to figure out what method I should use to create this, it seems it is beyond the reach of Excel from what I can find, also beyond the reach of Access, so I suspect it will involve some form of programming. I have basic understanding of VBA, but that's about it.
Can anyone make any suggestions.
Thanks
Working with data in this format will always be hard and I would not reccomend adding any drag and drop until you have sorted out the structure of your data.
You might like to consider another approach, which involves restructuring your data to make it easier to work with...
If you had one sheet with the following columns:
Teamname
Date (instead of Week Number and Day of week,)
Timeslot
JobNo
Address
Duration
Notes
Etc
Then each row would represent a job and have details of when it is occurring.
This is way a database would store the information about the jobs that are happening.
To change when a job is happening, all you have to do is update the date (and timeslot) of the row.
You could then create another worksheet for each team that uses excel formulas to lookup jobs happening this week and display them in a column for each day - like you have now. These sheets would be for display purposes only.
(You would use formulas like VLOOKUP etc)
If you want to change the date of a job you then simply go to the worksheet with the long list and change the date.
Having your data in this long list (ie normalised) format will give you many benefits. For instance you can summerise the report of the data using pivot tables.
If you add filters to the long list (SEE Ribbon>>Data>filters) you can order the data and reduce the list to only show jobs on a selected date, or for a selected team etc...
This is definitely the way forwards. Having restructured the data in this way, you could then add flashy ways to change when a job is taking place by adding buttons on the team worksheets or something.
PART2:
So in you ling list I would recommend excel CONCATENATE function to add an extra column with the text you want displayed elsewhere in your "calendar". #COLUMNA
I would also create another column which is a unique identifier for the row. This will probably be the "Date in YYYMMDD format & timeslot in HHMI format" concatenated together.
In the calendar view sheets say you need a column to display each day of the week with a row for each time slot: You need to
enter a StartDate of the period you want to view
Set up a column for each day (with a formula to calculate the date of the day (ie StartDate, StartDate+1 etc). The date is displayed as a column header (perhaps with a format that shows the dayname, but is stores the date)
each row will have a column that has the timeperiod name and each row will have a value entered. The value is the same as those used in the long list's timeperiod column.
When a user double clicks on a cell you can use the worksheet event
Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
in the VBA code, for this event you need to:
see if the cell double clicked is one you want to respond to
if it is find the date and timeperiod from the corresponding column and row header.
use VBA to activate the long list sheet and probably filter to only show the jobs taking place that day or perhaps that week. Then select (or highlight?) the job that was double clicked.
This is quite easy once you know VBA.
There is a lot to know though I would:
use a named range to define the row with the date and another to define the column with the timeperiod
use a named range to define the cells that will respond to a double click
use range functions in VBA like intersection and the entirerow, entirecolumn range properties to find the date and timeperiod of the double clicked cell.
use the macro record to write the initial code that will do the filter.
adjust the code to be well written and to find the date and timeperiod as required.
Create a sheet for all departments? Or just create one sheet where the dept can be chosen.
You could get clever and allow the user to select two cells in the calendar and provide buttons that do things like:
swap the jobs
If they select many cells then a button to Goto the list and only show jobs that were selected in the calendar.
Perhaps the user could select one job and buttons could move the job back or forwards 1,2,7,14 days.
Note that you can use the long list to record other details of the job like time taken, customer, start time, end time etc...
See about Pivot tables here which might give you some ideas about how you can summarise you data to give info like jobs per day, total value of jobs by day, etc...
Before you tie yourself in knots using Excel, you should always consider using Access.... as with someone who know what they are doing, access will deliver a lot more in a shorter period of time and can do nice things like print one page per job etc etc...
(Do you need a contractor?)
mr#HarveyFrench.co.uk
i am developing an app for windows in vb net.
I am stuck in the last part which is the following and i would like some help on to where should i look or do.My question:I have one database in mysql called patient.each patient have the usual columns(name,surname etc..).Apart from all the columns there is one column called 'time' and another one called 'date'.I have also one datagrid where these values are displayed.When a new user is to be added,all the fields are filled and in the 'time' he fills the time of visit.I would like to ask if there is any way to restrict the range of time according to date...for example to be able in the beginning before adding the new patient,to say that in august 30 of 2014 the range of time for appointments is from 9 to 10.So when the new patient is added on that date ,to book only between this range every ten minutes eg 9:10,then 9:20 and so on until 10.
I am really stuck and been searching the last week for a solution ,so any ideas on the implementation would be appreciated.
Thank you in advance..If you need some of my code let me know.
If you want to restrict the input data, you have to use the DataGridView's CellValidating event. There you can check wether the input is ok or not. If it's not ok, you can set the ErrorText field of the edited row, where you can explain to the user what's wrong with his input.
Have a look at this HowTo from the MSDN.
I have a form of multiple project sites where one of the fields is labelled "Project Start Date". I have another field in the form labelled "Projected Project Finish Date". Both fields are stored in a table labelled "General Project Info" (well, at least that's the source of the information for the form come from).
I could manually fill in the Proposed Project Finish Date by adding 10 days to the Project Start Date, but I would like to make it a calculated field, i.e once someone puts in the Project Start Date Access automatically calculates the Proposed Project Finished Date.
I am aware you can use a query to calculate this: New Query-->Include Project ID and Project Start Date fields, then make the third field--> Proposed Finish Date: DateAdd("d",10,[Project Start Date]). This produces a query result which has a column with all the sites, a column with the Project Start Date and a column with a date that is 10 days later. Perfect. But, how do I store those new results in my existed General Project Info table and have them appear in the form? I'm obviously a beginner and am missing something.
Thanks for any help in this matter.
Oh, I am using Access 2007.
You can use the After Update event for Project Start Date on your form to update the Project End Date control to Project Start Date + 10, but if the answer is always + 10, why store the date at all? Just use your query to show the end date.
Private Sub StartDate_AfterUpdate()
Me.EndDate = Me.StartDate + 10
End Sub
Or
SELECT StartDate, StartDate + 10 As EndDate FROM ATable
Edit
To add an After Update event, use the property sheet in form design view. Select [Event Procedure] and then click the three little dots. It will open up the code window and you can add code into the event. You will need to use the proper names for you controls, but if you type Me., intellisense will help you along with names of properties, methods and controls.