Data Report question

I have a report in VB using the DataReport Designer, linked up to an Access 2000 database. In one of the tables I have a numeric column that has a number representing a quantity of hours (eg 3.25 = 3 hours 15 mins).

My problem is I want the report to say 3 Hrs 15 Mins, not 3.25.

Any ideas would be appriciated, I dont want to alter the format of the column that holds the Hours, but I dont mind adding too the database if there is a way it can be done through linking.

Thanks In advance

Nobbin

Comments

  • Use an Access Query for the report and not an Access Table. If you do this, you can simply use two seperate calculated fields to get the hours and minutes, or build a string right there in the query.


    -ray


    : I have a report in VB using the DataReport Designer, linked up to an Access 2000 database. In one of the tables I have a numeric column that has a number representing a quantity of hours (eg 3.25 = 3 hours 15 mins).
    :
    : My problem is I want the report to say 3 Hrs 15 Mins, not 3.25.
    :
    : Any ideas would be appriciated, I dont want to alter the format of the column that holds the Hours, but I dont mind adding too the database if there is a way it can be done through linking.
    :
    : Thanks In advance
    :
    : Nobbin
    :

  • Thanks Ray,

    I think im on the right tracks now, Ive managed to create a query in Access that creates an integer value of the minutes only (so I can strip the decimal place from the hours to display both values seperatly). But as im new to DB programming (alright, im not new, im just not very good) I dont know how to get that Access Query onto the Report..... Any ideas anyone please???

    This is the code I use to create the Report dynamically (No data environment).

    [code]Private Sub cmdReport_Click()

    Dim SQL As String

    SQL = BuildSQL("*", "DTSubmit")

    Query SQL
    Set Report1.DataSource = Nothing
    Report1.DataMember = ""

    Set Report1.DataSource = RSdyn.DataSource

    With Report1.Sections("Section1").Controls
    For i = 1 To .Count
    If TypeOf .Item(i) Is RptTextBox Then
    .Item(i).DataMember = ""
    End If
    Next i
    End With
    Report1.Show
    End Sub[/code]

    : Use an Access Query for the report and not an Access Table. If you do this, you can simply use two seperate calculated fields to get the hours and minutes, or build a string right there in the query.
    :
    :
    : -ray
    :
    :
    : : I have a report in VB using the DataReport Designer, linked up to an Access 2000 database. In one of the tables I have a numeric column that has a number representing a quantity of hours (eg 3.25 = 3 hours 15 mins).
    : :
    : : My problem is I want the report to say 3 Hrs 15 Mins, not 3.25.
    : :
    : : Any ideas would be appriciated, I dont want to alter the format of the column that holds the Hours, but I dont mind adding too the database if there is a way it can be done through linking.
    : :
    : : Thanks In advance
    : :
    : : Nobbin
    : :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories