Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ragh
Starting Member
34 Posts |
Posted - 2005-02-10 : 23:57:44
|
| HiI have a table comprising of fields like:SLNo(int) ID name date(datetime) timein(datetime) timeout(datetime) TWH(int) Duration(char)values are:ID Name Date TimeIn TimeOut TWH Duration0005 Ragh 2005-01-31 15:32:00 15:36:00 2400005 Ragh 2005-01-31 15:38:00 15:39:00 600005 Ragh 2005-01-31 15:40:00 16:01:00 12600005 Ragh 2005-02-01 15:40:00 16:01:00 1260----Well, i can write this query in SQL Server like this and store Sum value in duration by convrting it into Hour and minutes.SELECT * FROM grtable ORDER BY id, date COMPUTE SUM(twh)BY id, dateI want to have similar in MS Access, when i try it doesnt work.I tried this query, and it show Invaid Use Of NULL runtime error 94 in VB.SELECT SUM(TWH)FROM grTable WHERE ID = " & "'" & id & "'" & " AND [Date] = " & varDateWhy ? and how can i achieve it in access something i can do in SQL Server.-----Task:Just want to calculate total Hours and minutes for particular id on that particular day and store it under duration column.---can someone help me pls...regardsRagh |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-02-11 : 00:25:47
|
| Try thisSet Rs=Con.Execute("SELECT SUM(TWH)FROM grTable WHERE ID = '" & id & "' AND [Date] = #" & varDate & "#")Madhivanan |
 |
|
|
ragh
Starting Member
34 Posts |
Posted - 2005-02-11 : 00:32:33
|
| madhivanan, nandri :) its working thank youRagh |
 |
|
|
|
|
|