I solved using this query.
SELECT
convert(varchar (5),convert(dat etime,cast(((DA TEDIFF(minute, StartTime, EndTime) - cast(BreakPerio d as int)) / 60) as char(5)) + ':' + cast(((DATEDIFF (minute, StartTime, EndTime) - cast(BreakPerio d as int)) % 60) as char(5))),108) as TotalCalculated Hours
from tblEmployee
User Profile
Collapse
-
subtract two datetime values
Hi,
I am searching for a way to find the total no of hours:min between two dates.
My table design is as below:
EmployeeId | StartTime | EndTime | BreakPeriod |
Sample data:
100 | 2011-09-14 08:00:00.000 | 2011-09-14 15:30:00.000 | 30
I need to find the total no of hours:mm between these two datetime values. (excluding the breakperiod).
-----
... -
Thanks for the reply!
I do not have much in-depth knowledge in Linq or generics but i am good in the basics level.
Is it possible to use generics with Linq to override the default sorting in linq?Leave a comment:
-
sort alphanumeric values
Hi,
Does anyone know how to sort using linq-entity.
i use the following code:
from i in objEntities.Ite ms
where ....
orderby i.Name
select i
The result is item1,item2,ite m21, item22, item3. But, i want it to be like item1, item2, item3, item21, item22
Thanks -
print datagrid in asp.net
Hi,
I am using a hierarchical data in a web form with 4 nested levels.
I have created a nested GridView. It displays well. But, now i need to print this GridView. I tried this code
...Code:<script type="text/javascript" language="javascript"> function CallPrint(strid) { var prtContent = document.getElementById(strid); var WinPrint = window.open('',Last edited by Frinavale; Dec 5 '11, 07:24 PM. Reason: Added code tags and fixed the spelling of the word "Please". -
Thanks a lot
1) Can you plz suggest me an alternative solution then?
2) --- I also have a doubt. I have a update panel with just a gridview, with inline editing,deletin g. It is a very simple page. Outside the update panel are just 2 controls: a search textbox and a button. On clicking the button, textbox is not getting cleared. (in the txtBox_Click event handler). so i wrote a jquery function to clear the textbox's...Leave a comment:
-
nested update panel and gridview events
Hi,
I use 2 update panels, nested with each other
1st update panel contains GridView1
2nd update panel contains GridView2. Gridview2 contains GridView3. But GridView3 just displays data. It has no rowcommand or any events.
My problem is when a button in GridView2 is clicked. both GridView1 and GridView2's rowcommand event are fired. But, i do not want the GridView1's Rowcommand event to fire.... -
-
Pivot table in asp.net gridview control
Hi,
I have 4 tables in my database. i want to create pivot table using them in a gridview.
1) Category
CategoryID CategoryName
1 Milk
2 Nuts
3 Fruits
4 Vegetables
5 Cakes
2) SubCategory
SubCategoryID CategoryID SubCategoryName
1 1 Soya
2 2 Almonds
3 2 Cashew
4 3 Apple
5 3 Orange
6 3 Grapes
... -
I searched for a solution in may forums.
But seems like it can't be done with a single query.
The only way is to use a stored procedure or function.
Thanks for the helpLeave a comment:
-
Thank you.
But i want to do the whole transfer in a single query without using stored procedures. This query will be called from csharp console application. Or is it possible to create a temporary stored procedure and delete it once the transfer is complete.Leave a comment:
-
How to copy rows from one table to another with same structure
hi,
I need to copy tableA and tableB from database1 to database2. Both table has the same structure. Only PlanID 1 and PlanID 2's values should be copied
tableA is copied, but tableB is a bit confusing.
DATABASE1
tableA
ItemID | PlanID | col3 | col4 | col5 ......
------ | -------|------|------|----------
21 | 1
22 | 1
23 | 1
24 | 1
25 | 1
26 | 2
27...
No activity results to display
Show More
Leave a comment: