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.
how to search data?
Collapse
X
-
You can easily implement all that logic at the backend by writing some procedure or function and calling that from VB. -
Okay,Originally posted by taepywould u give me some example?
Explain detail about your problem and front-end and back-end versions.
Better you explain your problem with some exampleComment
-
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
-
Again you are doing the same thing.Originally posted by taepyall 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.
- 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
-
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 2003Comment
-
Originally posted by taepyim 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
Comment