| | |
[Urgent] Timing Allocation Problem
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2008
Posts: 27
Reputation:
Solved Threads: 0
Lets say i do this to count the number of that particular hour:
Refer to the data below:
1.2008/06/24 02:00
2.2008/06/24 12:00
3.2008/06/24 06:00
4.2008/06/24 17:00
5.2008/06/25 06:00
The first will be allocated to hour=02 and the second one will go to hour=12.
However i face this problem: How if 3 and 5 having the same hour but different date? I need to get the date as well. Can i solve this problem using almost the same coding format above? I need to keep count(hour, 0) = count(hour, 0) + 1 this way. Thanks a lot.
VB.NET Syntax (Toggle Plain Text)
If vDateTime.Hour > 0 And vDateTime.Hour < 24 Then Dim hour As Integer = vDateTime.Hour If hour = 0 Then hour = 24 End If count(hour, 0) = count(hour, 0) + 1
1.2008/06/24 02:00
2.2008/06/24 12:00
3.2008/06/24 06:00
4.2008/06/24 17:00
5.2008/06/25 06:00
The first will be allocated to hour=02 and the second one will go to hour=12.
However i face this problem: How if 3 and 5 having the same hour but different date? I need to get the date as well. Can i solve this problem using almost the same coding format above? I need to keep count(hour, 0) = count(hour, 0) + 1 this way. Thanks a lot.
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
First:
In the 24 hour system you will never have a 24. It only goes to 23:59:59 then 00:00:00.
So you don't need the if statement.
Next:
It looks like your dates are comming in in order. I would make my array hold date and count. Then when new date comes in remove the seconds and minutes and compare it to the last date entered. If they are the same increment the count. Otherwise add the new date to the array.
In the 24 hour system you will never have a 24. It only goes to 23:59:59 then 00:00:00.
So you don't need the if statement.
Next:
It looks like your dates are comming in in order. I would make my array hold date and count. Then when new date comes in remove the seconds and minutes and compare it to the last date entered. If they are the same increment the count. Otherwise add the new date to the array.
Wayne
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
•
•
Join Date: Sep 2007
Posts: 60
Reputation:
Solved Threads: 0
•
•
•
•
First:
In the 24 hour system you will never have a 24. It only goes to 23:59:59 then 00:00:00.
So you don't need the if statement.
Next:
It looks like your dates are comming in in order. I would make my array hold date and count. Then when new date comes in remove the seconds and minutes and compare it to the last date entered. If they are the same increment the count. Otherwise add the new date to the array.
I need to allocate the 24-hour time selected by the user to an array of size 24, for example, If the user choose 2day 8AM until tomorrow 7AM, Then my idea is:
hourarray(0)=8AM
hourarray(1)=9AM.....
..hourarray(23)=7AM...
How can i loop it? Thanks
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Bowling Bot
- Next Thread: AutoGenerateSelectButton
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy image images insert intel internet listview login math mobile monitor ms navigate net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port print problem problemwithinstallation project reports" save savedialog searchbox searchvb.net select serial soap string table tcp text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





