View Complete Post
I am using the below query to get difference beiween two dates in hours and minutes.Minutes part look ok but the hours is incorrect.
select datediff(minute,LastDate,getdate()) as "Minutes", datediff(hour,LastDate,getdate()) as "Hours"from emp.
Note: Using SQL Server 2005
I have 10:45 Hours and Now I want to get Total Minutes Like 645 Minutes.
How Can I Get in SQL Server 2005?
Please Help Me................!
Thanks in Advanced..............!
One of my users is getting the following error:
Here is what I have pin pointed it down to:
cmd.CommandText = "InsertExportPairing"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@pn", SqlDbType.VarChar, 50).Value = pairing.Number; cmd.Parameters.Add("@pt", SqlDbType.Time, 7).Value = pairing.FlightTime.Insert(2, ":"); cmd.Parameters.Add("@date", SqlDbType.Date).Value = DateTime.ParseExact(pairing.Date, "MMM dd, yy", CultureInfo.InvariantCulture); cmd.Parameters.Add("@uid", SqlDbType.Int).Value = userID; SqlParameter outParam = cmd.Parameters.Add("@newId", SqlDbType.Int); outParam.Direction = ParameterDirection.Output; cmd.Exe
Hi I have a report where I have to get the employees absence hours, i.e if there are 8 hours in a day and the employee worked for 5:50 minutes then the difference would be calculated in time.... Please also let em know how to calculate absence hours if the
working ours are null as its not showing any value for absence column
WorkingHrs HoursWorked Absencehours
8 5.10 2.50
8 Null Null
I have query that I have written to get the absenceHours= WorkingHrs - HoursWorked
Please help I feel its a simple query but kinda confused with it. Thanks.
I have migrated my web application to iis 7.5 Now I am using windows 7 as dev machine.
the problem is it takes several seconds to download a single page into web browser now. It contains only 300 records.
Everything is ok on prod website though. Prod version contains up to 200000 records .I can't also use code profile tool of red gate to analyze possible bottlenecks since the software in question can't restart IIS. No errors in IIS logs. I am using ISAPI Rewrite 3 filter by Helicon to apply some URL rewriting rules. I am thinking about conflict between ISAPI rewriting rules and default IIS 7.5 request filtering rules, since the IIS request filtering module gets a higher priority than even the built-in IIS 7.5 rewriter module. Is it possible to tweak the module through web.config so that priority is given to ISAPI rewriting rules or something like that?
Frankly, I spent several days to figure out solution. No success...
I've also deployed the application on IIS 5.1. Everything works fine. Any ideas about possible solution for IIS 7.5?
I have tried searching all over the web for this logic. Got many but half of them did not match what i was looking for and half were malfunctioning.
I want to calculate business working hours between 2 datetime, where in I should be able to set the working hours as well as weekends and holidays should not be calculated.
Please help me guys... It will be a great help...
MSDN Magazine October 2003
ASP.NET is a flexible and extensible framework for server-side HTTP programming. While most people think of ASP.NET in terms of pages served, there is a lower-level infrastructure sitting beneath this page model. The underlying plumbing is based on a pipeline of app, module, and handler objects. Understanding how this pipeline works is key if you want to get the most out of ASP.NET as an HTTP server platform, while making your process more efficient, and keeping your server secure. This article introduces the architecture of the pipeline and shows how you can use it to add sophisticated functionality to an ASP.NET-based app.
Tim Ewald and Keith Brown
MSDN Magazine September 2002
I have an entity set of NotificationTemplates, and each one of these has a collection of zero-many SmsTemplate entities. When editing or viewing a NotificationTemplate, I have a link to View SMS Templates. That link takes me to a List view for the SmsTemplates entity set, filtered for the NotificationTemplate I was viewing.How can I prevent the user changing this filter to show SmsTemplates for another NotificationTemplate? That is, I want the filter, but it must be read only. The drop-down just mustn't drop down, it must just display the name of the NotificationTemplate that these SmsTemplates belong to. To view SmsTemplates for another NotificationTemplate, the user must click View SMS Templates from that other template.
This was originally asked by myself on SatckOverflow at: http://stackoverflow.com/questions/3514373/disable-filtering-on-a-dynamic-data-list-view
On occasion the incrmental crawls; which usually take under 1 minute take hours to run.
The crawl logs show a successful crawl message and the nothing til it completes, not a single log entry.
It will eventually finish and the next incrmemental will run just fine.
No errors or anything to speak of.
Index has 800K items
My SetUp (I am using EF for my data):
1 Grid bound to a collection of Vehicle Objects
1 Combobox with multiselect enabled bound to a list of VehicleExtras.
Each vehicle has a collection of extras.
What I need to do is have the Grid filter Vehicles based on whether those vehicles have the selected VehicleExtras from the Combobox
Can anyone point me in the right direction as to how this filtering should be done (if it is at all possible!)
I write a custom StringFilter to use as filter control for string properties, I use bellow code to "GetQueryable" method :
public override IQueryable GetQueryable(IQueryable source)
string selectedValue = TextBox1.Text;
object value = selectedValue;
if (DefaultValues != null)
DefaultValues[Column.Name] = value;
return ApplyEqualityFilter(source, Column.Name, value);
the disatvantage of this method is user must enter whoul string to find...
can any body help me to change this method to work such as sql "Like" method instead of equality ?
Hi, I am using forms authentication. My web.config file contains this:
<forms loginUrl="Login.aspx" defaultUrl="LeaseTracker.aspx" protection="All" timeout="30" slidingExpiration="true"/>
And the login includes this:
FormsAuthenticationTicket formsAuthenticationTicket =
new FormsAuthenticationTicket(1, userName, DateTime.Now, DateTime.Now.AddMinutes(30),
_isPersistent, userData, FormsAuthentication.FormsCookiePath);
Any ideas on why it would be treating the user this way?
for Business needs i am planning to increase the session timeout to 2 hours(120 min) in one application, i am using sql server session state. if i increase to 2 hours of session time out, how it will effect the performance of application and web server.
Could any one help me on this.
I have a gridview, based on thsi datasource:
<asp:SqlDataSource ID="SqlDataSourceAllLoads" runat="server"
ConnectionString="<%$ ConnectionStrings:tplatz_dk_dbConnectionString %>"
SelectCommand="SELECT DISTINCT DATEADD(day, 0, DATEDIFF(day, 0, tblDelivered.delivered_Date)) AS delivered_Date, tblDelivered.delivered_LoadNo, tblDelivered.delivered_TrailerNo, ISNULL(tblDeliveredInfo.deliveryInfo_FirmaNavn, N'?') AS Expr1 FROM tblDelivered FULL OUTER JOIN tblDeliveredInfo ON tblDelivered.delivered_LoadNo = tblDeliveredInfo.deliveryInfo_LoadNr ORDER BY delivered_Date DESC">
Using a dropdownlist, I can filter (by changing datasource) the results based on customer names in a dropdownlist. This datasource, working perfectly, looks like this:
<asp:SqlDataSource ID="sqldataSourceKundeLoads" runat="server"
ConnectionString="<%$ ConnectionStrings:tplatz_dk_dbConnectionString %>"
SelectCommand="SELECT DATEADD(day, 0, DATEDIFF(day, 0, tblDelivered.delivered_Date)) AS delivered_Date, tblDelivered.delivered_LoadNo, tblDelivered.delivered_TrailerNo, ISNULL(tblDeliveredInfo.deliveryInfo_FirmaNavn, N'?