0

Dear Sir Please Help Me that,I want to get result after Calculating here wag=4349 not as Wag=4349.25 that means just like Round Function In Excel

wag = (Val(bsc) / Val(DropDownList1.Text)) * Val(TextBox7.Text)
        TextBox9.Text = Val(wag)


esic = (Val(bsc) / Val(DropDownList1.Text)) * Val(TextBox7.Text)
        TextBox9.Text = Val(wag)

and also how is this possible to use Just like Roundup Function in Excel as
esic=71.1 then need to be esic=72

Is it Possible also in Access Query Analyzer ?
If possible Please Help Me

Thanks

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Fortinbra
0

You may want to set a datatype with your val() functions. such as
if you want the decimals:

wag = (Val(bsc) as Double / Val(DropDownList1.Text)as Double)*Val(TextBox7.Text) as Double
TextBox9.Text = (Val(wag) as Double).ToString

this is provided your doing this in VB. If you don't want the decimals just tell it to use integers instead. and make sure the datatypes of all your variables match. If you don't want decimal points, never use a double, unless you plan on casting it to an integer.

0
Dim a, j, k, wag, hra, ta, oth, bsc, pf, esi As Double

        str = "select *from emp_details where card_no='" & TextBox2.Text & "'"
        cmd = New OleDbCommand(str, cn)
        dr = cmd.ExecuteReader()
        If Not dr.Read = False Then
            
            bsc = dr.GetValue(7)
            a = dr.GetValue(8)
            j = dr.GetValue(9)
            k = dr.GetValue(10)

        End If
        dr.Close()
        wag = val(Val(bsc) as double   / Val(DropDownList1.Text) as double * Val(TextBox7.Text)as double
        TextBox9.Text = Val(wag)
        hra = Val(Val(a) / Val(DropDownList1.Text)) * Val(TextBox7.Text)
        TextBox10.Text = Val(hra)
        ta = Val(j / DropDownList1.Text) * Val(TextBox7.Text)
        TextBox11.Text = ta
        oth = Val(k / DropDownList1.Text) * Val(TextBox7.Text)
        TextBox12.Text = oth
        pf = Val((wag * 12) / 100)
        TextBox13.Text = pf
        esi = Val(((wag + hra + ta + oth) * 1.75) / 100)
        TextBox14.Text = esi
        TextBox15.Text = 5

Dear Sir Error Showing at Highlighted Text as Please Give me solution wag = val(Val(bsc) as double / Val(DropDownList1.Text) as double * Val(TextBox7.Text)as double

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.