how to search data?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • taepy
    New Member
    • Sep 2007
    • 9

    #1

    how to search data?

    i have a problem to search my data.i need to used the search data and do some calculation on it. its about the futsal court rent.i wanna calculate the income of that rent.but i dont know how to search the payment for the rent and calculate it. if i search from todays date by the end of this month,then i wanna calculate all the payments records..how am i gonna do this..i really dont know..i hope that theres someone who willing to help me.thank you.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You can easily implement all that logic at the backend by writing some procedure or function and calling that from VB.

    Comment

    • taepy
      New Member
      • Sep 2007
      • 9

      #3
      would u give me some example?

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by taepy
        would u give me some example?
        Okay,
        Explain detail about your problem and front-end and back-end versions.
        Better you explain your problem with some example

        Comment

        • taepy
          New Member
          • Sep 2007
          • 9

          #5
          all the payment made to the manager for the court rent will be recorded in rent.mdb
          then there will be a form that will allow the manager to calculate all the payment made by calculating all the data in rent.mdb.the manager will search the data based on the date.

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #6
            Originally posted by taepy
            all the payment made to the manager for the court rent will be recorded in rent.mdb
            then there will be a form that will allow the manager to calculate all the payment made by calculating all the data in rent.mdb.the manager will search the data based on the date.
            Again you are doing the same thing.
            • What calculation you want to do?
            • What is your Database Version?


            To search data by Date,
            [CODE=vb]
            dim strSql as String
            strsql="Select * from tblName where dateField = #" & format(dtDateva lue,"MM/dd/yyyy") & "#"[/CODE]

            Comment

            • taepy
              New Member
              • Sep 2007
              • 9

              #7
              im really sorry..im a beginner in vb actually..

              i wanna calculate the payment(in currency)

              example:
              date payment
              8/9/07 80
              8/9/07 70
              : :
              : :
              30/9/07 70

              by the end of the month,the system will be able to calculate all the payment.(sum up)

              the manager can search the sum by referring on the date.


              im using microsoft access 2003

              Comment

              • hariharanmca
                Top Contributor
                • Dec 2006
                • 1977

                #8
                Originally posted by taepy
                im really sorry..im a beginner in vb actually..

                i wanna calculate the payment(in currency)

                example:
                date payment
                8/9/07 80
                8/9/07 70
                : :
                : :
                30/9/07 70

                by the end of the month,the system will be able to calculate all the payment.(sum up)

                the manager can search the sum by referring on the date.


                im using microsoft access 2003


                For Day :
                [CODE=vb]
                dim strSql as String
                strsql="Select dateField, Sum(AmountField ) As DayTotal from tblName where dateField = #" & format(dtDateva lue,"MM/dd/yyyy") & "# group by dateField"[/CODE]

                For Month
                [CODE=vb]
                dim strSql as String
                strsql="Select Sum(AmountField ) As MonthTotal from tblName where Month(dateField ) = " & Month(dtDateval ue) & " and Year(dateField) = " & Year(dtDatevalu e) & " group by Year(dateField) , Month(dateField )"[/CODE]

                Comment

                • QVeen72
                  Recognized Expert Top Contributor
                  • Oct 2006
                  • 1445

                  #9
                  Hi,

                  For monthwise Group, u can use this query also:

                  [code=vb]
                  dim sSQL as String
                  sSQL ="Select Format(DateFiel d,'mm-yyyy'), Sum(AmtField) As MonTotal from MyabName Group By Format(DateFiel d,'mm-yyyy')"
                  [/code]

                  REgards
                  Veena

                  Comment

                  • taepy
                    New Member
                    • Sep 2007
                    • 9

                    #10
                    thanks 4 all the replies..i really appreciate it..

                    Comment

                    Working...