473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

probleum in multiplication in vb.net

40
i used the following code in vb 6.0 and it produced the required value
but when i used the same code in vb.net it shows the error
"Operator * is not defined for types Date and Integer"
Dim Act_Rec As Integer
Dim VTar_Hr As String
Dim VYptime As String
VTar_Hr=300
VYptime="7:30:00"
Act_Rec = CInt(VTar_Hr) * (CDate(VYptime) * 24)
please help me

with best regards
varinder
Jan 28 '09 #1
4 2577
DrBunchman
979 Expert 512MB
Hi Varinder,

What is it you are trying to acheive? I can't see why you would be multiplying a Date by an Integer but if you let us know we may be able to help.

Incidentally, in VB.NET you can use

Integer.Parse(VTAR_Hr) rather than CInt(VTar_Hr)

and

Date.Parse(VYptime) rather than (CDate(VYptime)

Also the very useful TryParse function:

If Integer.TryParse(VTAR_Hr, Nothing) = True Then

will come in handy for checking that your variables are of the correct type. Not relevant to your question exactly but useful to know :-)

Regards,

Dr B
Jan 28 '09 #2
progvar
40
thanks Dr B
Actually i want to find the average work of a person who entered 300 records in any database in one Hour .Then how many records would be entered in 7 hrs and 30 minutes

this is my main motive
Jan 28 '09 #3
DrBunchman
979 Expert 512MB
I've taken the number of hours and number of minutes from the Date variable and used them to calculate the total like this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim iRec As Integer = 300
  3. Dim iTotal As Integer
  4. Dim dt As Date = "07:30"
  5. iTotal = (dt.Hour * iRec) + ((dt.Minute / 60) * iRec)
  6. Response.Write(iTotal)
  7.  
Hope this helps,

Dr B
Jan 28 '09 #4
progvar
40
thanks very much Dr B
because this probleum was creating lot of trouble for me

thanks again
varinder
Jan 28 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

54
by: Andy | last post by:
Hi, I don't know if this is the correct group to post this, but when I multiply a huge floating point value by a really small (non-zero) floating point value, I get 0 (zero) for the result. This...
9
by: Ralf Hildebrandt | last post by:
Hi all! First of all: I am a C-newbie. I have noticed a "strange" behavior with the standart integer multiplication. The code is: void main(void)
87
by: Vijay Kumar R Zanvar | last post by:
Hi, Why multiplication of pointers is not allowed? Till now I only know this, but not the reason why! PS: As a rule, I searched the FAQ, but could not find an answer. -- Vijay Kumar R...
17
by: Christopher Dyken | last post by:
Hi group, I'm trying to implement two routines to handle 32x32-bits and 64x64-bits signed integer multiplication on a 32 bits machine in C. It easy to find descriptions of non-signed...
2
by: veer | last post by:
hello expert i made a website which opens in ie6 and works fine but when i open it in ie7 it creates probleum the probleum is that i have a footer in my webpage , it automatically moves in the...
4
by: veer | last post by:
hi i have programe in which works fine for seaching the data from a file but when the i want to seach the word like" mögen ". In this word " ö " has some other kind of shap and my programe did not...
2
by: veer | last post by:
Hi i made a programe in which i want to calculate the total time from a column but when i declare a variable having datatype is "date" then the default value in this variable is "12:00:00: and...
3
by: veer | last post by:
Hi i have some probleum in reading the data from .val extension file when i manually open the file in notepad and just click on file option -> save -> close the txt file and then read the data...
1
by: Sozos | last post by:
Hi guys. I have a problem with writing the base case for the following matrix multiplication function I have implemented. Please help. #define index(i,j,power) (((i)<<(power))+(j)) void...
1
by: veer | last post by:
hi i think it's a silly question but i am very confused about this actually i made program on spell check.This is done by creating object of msword and then with the help of this object i create...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.