Results 1 to 3 of 3

Thread: Data Environment & data report help please

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    31

    Data Environment & data report help please

    i need to view salary payslip (data report) based on that particular month and year.

    in Data Environment sql :

    SELECT[emp_id], [emp_name], [emp_position], [emp_bs], [month_paid], [year_paid], [total_addition], [gross_pay], [total_deduction], [total_pay] FROM salary WHERE month_paid = ? and year_paid = ?

    parameter is monthler

    parameter is yearler


    in vb code:

    Code:
    Dim intMonth As Integer
    Dim intYear As Integer
    
    ' is a combo box that select month
    
    If cboMonth.ListIndex = 0 Then
        intMonth = 1
    ElseIf cboMonth.ListIndex = 1 Then
        intMonth = 2
    ElseIf cboMonth.ListIndex = 2 Then
        intMonth = 3
    ElseIf cboMonth.ListIndex = 3 Then
        intMonth = 4
    ElseIf cboMonth.ListIndex = 4 Then
        intMonth = 5
    ElseIf cboMonth.ListIndex = 5 Then
        intMonth = 6
    ElseIf cboMonth.ListIndex = 6 Then
        intMonth = 7
    ElseIf cboMonth.ListIndex = 7 Then
        intMonth = 8
    ElseIf cboMonth.ListIndex = 8 Then
        intMonth = 9
    ElseIf cboMonth.ListIndex = 9 Then
        intMonth = 10
    ElseIf cboMonth.ListIndex = 10 Then
        intMonth = 11
    ElseIf cboMonth.ListIndex = 11 Then
        intMonth = 12
    End If
    
     is a combo box that select year
    
    If cboYear.ListIndex = 0 Then
        intYear = 2007
    ElseIf cboYear.ListIndex = 1 Then
        intYear = 2008
    ElseIf cboYear.ListIndex = 2 Then
        intYear = 2009
    ElseIf cboYear.ListIndex = 3 Then
        intYear = 2010
    ElseIf cboYear.ListIndex = 4 Then
        intYear = 2011
    End If
    
    
    
    ' how should i pass a value to a Data Environment sql query ?
    or got other way to do ?
    ' i need view that month and year that i have selected. 
    'P_Payslip.Show

  2. #2
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    Re: Data Environment & data report help please

    use command object parameter collection
    Code:
    DataEnvironment1.Command1 (intMonth , intyear)    
    P_Payslip.Show

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Data Environment & data report help please

    Moved to reporting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width