Sharepoint date difference formula - sharepoint-2010

I have a problem in Sharepoint 2010. I have a list with two columns, [Start date] and [End date]. I've made a new column, a calculated field, in which I want to see the difference between the two dates, like "8h 34m" (hours and minutes only). The problem is that [End date] could be empty, so this new column should be empty as well, if that's the case. The formula I used has errors, and I can not find another one. Could you help me?

=IF(ISBLANK([End date]),"",[End date]-[Start date])

Related

Subform updating another subform dates

I have a form with two subforms, one holds a clients details, the other the client's bookings, and this form compiles client details and bookings to make an invoice.
Due to GDPR and my own sanity I am required to delete a clients details 4 years after their last booking, but they may have many invoices over a number of years. At the moment every time i create an invoice it updates a control on the client details subform to the last booking in that invoice (as below), is there a way to make it check which date comes last and keep that one? I've had a play with Iif but am just really struggling.
At the moment i have
Private Sub Booking_subform_Exit(Cancel As Integer)
[booking contact subform].[Form]![latest booking].Value = [booking subform].[Form]![Max DATE]
End Sub
If I understand you question correctly you want to find the last date of all invoices for a client, correct? Try to use DMAX function:
DMax ( expression, domain, [criteria] )
It is similar to DLookup but it returns the highest value.

Tableau - Count Items in a Dimension based on what month they fall into

I am a newbie at Tableau (thought I have spent years working in R and Python), seems to be different in the way it handles things or I'm just not thinking the right way.
I have a data sources with training data (employees training and the status). The point is to build a dashboard that shows the % of training that is overdue. I have all of the logic for it, but I am stuck on something.
I have a calculated field to show me the total training due, then when I put that in a table, with a filter by year and a breakdown by month, I get the totals by month - good deal.
Now, I need to perform an year calculation (not the months, but the year based on a few different things), so my first step is I need to get the "Total Training Due" for December 2018. I have a dimension called "Due Month" which is a numeric (1,2,3,4, etc.) representing the month. So, based on what I have observed, I just need to do a little IF statement like so (keep in mind this is only for 2018 data right now):
IF [Due Month] = MAX[Due Month] THEN COUNT[Employee ID] END
I know this isn't the exact context, but it's sort of what I am looking for. So, for 2018, it would mean that, for all rows that are of month 12, I want to count those up (each row is a unique training requirement) and I want the total for the latest month in the data set. My overall goal is to create the calculation I need in a new sheet with a single calculated field (See the image below of the Excel spreadsheet and the J10 calculation). Then I can use a dashboard to combine everything. I thought about a total row at the bottom, but there isn't enough ways to change the totals to customize it to what I need. I figured I dashboard was the way to go and replicate each part it its own sheet.
I have seen so many suggestion for things like this, but not exactly this. I have tried many, but nothing that works. Here is the spreadsheet I am trying to replicate:
As you can see that calculation in J10 is kind of weird, no biggie for Excel, but I am struggling to replicate this in Tableau. Here is what I have in my Tableau so far, I'm 90% of the way there, I just need that last calculation. I have replicated the main table, and figure I'll do this J10 calc on a new sheet and just put them together on a Dahsboard. The only thing is, I want this to work when new data comes in, so I don't want to hard code any month numbers in there, I want it to be dynamic. Here is what I have on the tableau so far:
Thanks in advance!!
To get the value in Tableau that you have in F11 it's:
{FIXED [Due Year] : sum([Incomplete Overdue])}
You should be able to create that as another calculated field and then reference it, or include it directly in the Total Past Due Rate calculation.
This is an LOD calculation, the [Due Year] means that you only want the result dimensioned by the [Due Year] dimension, so you will get a different result for each year in the data source.
Thanks for this - after posting this, I was able to come up with this:
(TOTAL([Incomplete Overdue]) + SUM(IF ([Past Due]<0 AND INT([Due Month]) = {MAX(INT([Due Month]))}) THEN 1 ELSE 0 END)) / COUNT(IF INT([Due Month]) = {MAX(INT([Due Month]))} THEN [Employee ID] END)
Which works for the basic result I was looking for.

Access 2013 VBA Using same where clause for unbound subreports

I'm working with my boss on a project to keep things more organized in our company. I'm making a template we can use for our monthly reports that: a) print how many of (blank metric here) each team did b) how many distinct computers everyone worked on together (total number of computers worked on without counting the same computer twice) and how many departments are having issues (again distinct, not counting the same department twice).
We are organizing them by date, usually in months so each SQL query has a:
WHERE DATE BETWEEN [Start Date] AND [End Date]
So if we do each query by itself and you can look at everything from the dates you define through user input. The problem is when I have all the queries I need in one form (three subreports in one master report), I have to enter each queries respective [Start Date] and [End Date] - so 6 parameters which is really just the same two done three times.
Is there anyway to fix this using VBA? I haven't messed with VBA much, but I'm pretty comfortable with SQL. Thanks for the help!
There are many, many ways to achieve this. Common ones are:
Use a form to define the start and end date
If you call your form frmStartEnd, and have two textboxes, txtStart and txtEnd, in your query, you can use:
WHERE [DATE] BETWEEN Forms!frmStartEnd!txtStart AND Forms!frmStartEnd!txtStart
You can find more examples about using parameters here. Forms, TempVars and UDFs are applicable to this problem.

ACCESS QUERY MORE THAN 1 million records,not able to export

I have a query which pulls all records in a db, the criteria I have put is as per trust, but some trusts have data more that 1 million records, for which error is coming to split the records, the only field I can split is year, but stupidly I have uploaded dates as APR2016..JAN2017 etc as text. Can somebody help me write criteria where to as for the year 2016 or 2017 and pull records accordingly.
this is the current query
SELECT Database.[Org Code], Database.[Invoice Number], Database.[Amount Tax], Database.[Vendor Name], Database.Link, Database.MonthOfEntry
MonthOfEntry is the field where the year is updated.
Thanks in advance
If the format of the MonthOfEntry is field is always MMMYYYY, you may be able to do this:
SELECT [Org Code], [Invoice Number], [Amount Tax], [Vendor Name], Link, MonthOfEntry
FROM TableName
WHERE Right(MonthOfEntry, 4) = '2017';
I'm not sure how well it will perform, but that would be one way to restrict the records.
(as an aside, I should mention that normalization is often a large contender in how this type of stuff is handled, though I do realize that it's not always feasible to import fully normalized data...)
Also as an aside, I don't believe there's any particular limit on the number of rows returned in a query. Rather, I suspect the error you're receiving is due to the method of export. An alternative may be to do a code-based export rather than relying on some of the build-in commands, which are sometimes quirky.

SSRS 2008 R2 calulate new date from existing that's 1 year later and on Monday?

hoping someone can help. I have an textbox on a report that I need to calculate a new date value for from another date on the report.
I need to take an existing shipping date (say 5/5/2014) and calculate a new date which is one year later but on the Monday of that week (so would be 5/4/2015) -- we only ship product on Mondays.
I know I need to use DateAdd and probably DatePart but have been unable to find the proper formula.
can anyone help?
figured it out -- thanks for all the help. I took the idea that Gordon had, putting it in my select statement rather than trying to manipulate it in the expression area of the textbox on the report:`SELECT DATEADD(wk,DATEDIFF(wk,0,DATEADD(YY,1,o.REQ_DATE)),0) as NewDate'
works great! :)