.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

calculate between end time and start time workdays only

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :SharePoint
hi, i'm using the formula =DATEDIF([Start Time], [End Time],"d") to calculate the difference between 2 dates. now i need a formula that only calculate the workdays.

View Complete Post

More Related Resource Links

WCF Service: takes very long time to start up

Hi, What could be the reasons, why my WCF service takes up to 40 seconds to get started? My service class is set to [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] I am running a thread inside this class. The WCF service gets initialized and opened within the context of this thread. The Initialization: private void InitializeWCFService() {      // initialize servcie base addrresses      this.SetupBaseAddresses();      //MetaData behaviour : allow HttpGet      ServiceMetadataBehavior metaDataBehavior = new ServiceMetadataBehavior();      metaDataBehavior.HttpGetEnabled = true;      // initialize service host instance      this.seviceHost = new ServiceHost(this, this.httpBaseAddress, this.tcpBaseAddress);      // add service endpoints and behavior.      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Tcp), EndpointName);      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Http), EndpointName);      this.seviceHost.Description.Behaviors.Add(metaDataBehavior);      // MEX endpoint      this.seviceHost.AddServic

How to Hide Start Time and End Time for All Day Event in Sharepoint Calendar DispForm

Hi All, Currently, when I add my Calendar web part to my page it displays the date and time for start and end dates. How can I get my web part to hide the times and only show the start and end date when the All Day event box is checked?

Use Sharepoint Calendar Start Time field in calculated column

I'm trying to limit the calendar view to current week using the Sharepoint defined field Start Time. However, when I display the serial number behind the Start Time it looks like it is actually giving me the serial number for the Created Date field. I believe it is because the appointment is reoccurring but I'm hoping there is a way around it. I created a new testdate field and manually entered the date and set those appointments as all day events however they are not reocurring appointments. The testdate returns the correct serial number however the start time returns an incorrect serial number. SerialNumber1=DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time])) SerialNumber2=DATE(YEAR([testdate]),MONTH([testdate]),DAY([testdate])) Start Time  SerialNumber1 Testdate  SerialNumber2 8/31/2010 40420 8/31/2010 40421 8/31/2010* 40405    9/1/2010* 40405    9/2/2010* 40405    9/7/2010 40427 9/7/2010 40428 9/13/2010* 40405    9/14/2010 40434 9/14/2010 40435 9/14/2010* 40405    9/15/2010* 40405    *These are reoccurring appointments scheduled as all day events. The others were entered as one time appointments scheduled as all day events.

Using datediff to calculate elapsed time

Hi..my app requires an elapsed time calculation that I have done like thisCONVERT(Varchar, (DATEPART(dd, GETDATE() - DateAdded)-1) * 24 + DATEPART(hh,GETDATE() - DateAdded)) + 'h:' + CONVERT(Varchar, DATEPART(mi, GETDATE() - DateAdded)) + 'm' AS ElapsedTimeThis works.. I can then colour my grid view cells  accordingly using the substring function.. the problem is that I have been told that using GETDATE three times is not a good use of resources, is it possible to use the Datediff function to get the same result?thanksDan

How to measure WCF start up time ? ( WCF service .NET 3.5 hosted in IIS6 under win 2003 )

Hi ,   I have relative big and complex WCF (.net 3.5)service hosted in IIS 6 .  When IIS worker goes down , it takes a lot of time for service to wake up.  My question is how can I measure what exactly takes time ? Or its just service compilation time and nothing could be done here ? If I know what takes time I will try to optimize it .    Thanks. 

Map the start and end datetime fields of an historical dimension to the time dimension and the fact



I have a dimension with some historical attributes and I use start and end datetime fields to save the outdated records. I assume that when the cube is processed, each record in the fact tables is mapped to the matching record in the dimension by using the combination of the key attribute with the start and end datetime fields. My question is how to configure the mechanism so that it will know which field is the datetime field and use it to do the comparisons with the start and end fields?


ASP.NET upgrade seems to be taking a very long time to start


At work I'm tryhing to upgrade an ASP.NET 2.0 app (which we wrote using VB.NET 2005) to ASP.NET 4.0.  I had a few problems during the upgrade, but eventually worked them all out.  At the end of the day I decided to give it a quick compile and see if I'd get the start page, so I hit F5 in VS 2010.  I left it that way, and man was it acting weird.  VS 2010 wasn't responding to anything.  If I hovered the mouse over VS 2010's minimize or close buttons, in the upper right corner, then those buttons were flashing very rapidly.  I'm not sure what was going on.  After waiting 15 minutes to see if it would come up, I decided to try clicking on the close button.  Nothing happened.  Eventually, I had to leave (I take public transit, and I have to leave when the bus comes), but I thought I'd leave it going as is, in hopes that it might fix itself.

But what I want to know is this, is this pretty standard behavior?  Does it normally take this long to do this?  This website is of modest size (<100 pages).

SPListItem "Start Time" for recurring events when building a task reminder Timer job.


I have a timer job that looks at maintenance events (calendar list) planned 5 days in the future and moves them to the current todo list. It then marks that maintenance item as copied so it is not double copied to the current todo list.

This works good for single event maintenance items but not for routine or recurring maintenance items. The reason is the recurring events have a "start time" of the first event so after the first one gets moved the rest are all interpreted as being in the past, since (I think) the recurring events start time is generated as an offset of the original event at runtime. How would I get a collection of ALL the Event items that are 5 days out (single and recurring) within a timer job.




Expanded recurrence items cannot be updated

Calendar View: Unable filter Recurring Event by Start/End Time and Group by Recurring Event View

Hi All,
I have just found several issues with Calendar View from WSS 3.0:

Unable to filter by [Start Time] and [End Time]
I am not sure why these 2 columns doesn't appear in the Filtering column in the View Settings. The workaround found in the internet is to create calculated column for Start Time and and End Time. However, it doesn't work for Recurring Event, the calculated column will show only first recurring event Start Time.

Unable to use "Group By"
When I create new view in Calendar using format: "Standard View, with Expanding Recurring Events", there is no option to specify "Group By". Anyone knows how to show all recurring event in List view and grouped by Start Time (or any other column).

Thank you and apprecate for any idea.

Calculate Web Application Idle Time


Hi all,

I have a requirement to calculate the Web application idle time. 

Say the user doesnt use the web application for 15 minutes, then a message needs to be displayed to the user.

How can this be done.

How To Store Task Start Time and Task End Time in log table using SSIS?


Hi All,


Present my log table storing each task functionality  Same log table in that  I want store every task start time and end time also. How to implement this in ssis?





How to hide the Start Time and End Time columns in Alert email in Sharepoint ?



I want to  hide the Start Time and End Time columns in Alert email.

These columns I have hidden in the Calandar control but still showing in the email message...

Any help appriciated....


Srikanth Reddy

Event Start Time showing 1/1/0001


Hi there,


I have a workflow in Sharepoint Designer 2010 and the action I have added is to log the Event Start Time when the workflow starts on a Calendar item.  Start Time is being logged as 1/1/0001.  but it shows up as the correct start time on the list view of the Calendar.  How can I access and log the correct Event Start Time in my workflow?



Workflows take a long time to start programatically


This is a reposting from "SharePoint 2010 Long Starting if start workflow programatically" by OlegO because I've ran into the same issue and can not find Oleg's re-post to a more appropriate forum as suggested by Clayton Cobb. Oleg writes:

In SharePoint 2010, I'm starting workflow #2 programatically from my workflow #1. See code below:

	SPList currentList = web.Lists[new Guid(ListId)];
	SPListItem currentListItem = currentList.GetItemById(ListItem);

	//resolve any lookup parameters
	string workflowId = base.ProcessStringField(WorkflowIdentifier);

	//find workflow association by name
	SPWorkflowAssociation workflowAssoc = currentList.WorkflowAssociations.GetAssociationByName(workflowId, 

	if (workflowAssoc != null)
		//start the workflow
		SPWorkflow workflow = site.WorkflowManager.StartWorkflow(currentListItem, workflowAssoc, 

How to calculate total hour and minutes within time range


I need to prepare a yearly management report to show the total overtime (OT) work hours and minutes of all staff within time range and month.


The time format in database is as follows:

Each record will contains the FROM date & time and TO date & time


The report layout is as follows:



I had no idea how to divide and calculate the total hours & minutes within the time range as each OT records will overlap several time range and date.

Please help. Thanks.






Time Calculate



I have a problem:

I want to create calculation member in my cube filter data by last year and previous of last year in data.

For example in [Adventure Works] database, I have Date dimension with year(2005,2006,2007,2008,2010) and I want to create Calculation member like

Last Year:

Sum([Measures].[Internet Sales Amount], [Date].[Calendar].[Calendar Year].&[2010])

Replaced by

Sum([Measures].[Internet Sales Amount],ClosingPeriod [Date].[Calendar].[Calendar Year]))

I use ClosingPeriod. But if I want get data of previous of last year like:

Sum([Measures].[Internet Sales Amount], [Date].[Calendar].[Calendar Year].&[2008])

SQL Server Query request for start and end period of time


Hi all

I have event table where I need to select records between days. my statements look like

  CONVERT(char(8),Event_Table.Event_time,112) BETWEEN 'request start date' AND 'request end date'

The Event_time is DateTime format.


Now everything look fine except from if I need the statement to request the date between as Date_start and Date_End any time it run. The idea is to request a for start and end period of date any time the scrpt run. the script will be run as DOS batch file. 

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend