hi experts, can anyone help me with this:
this is my formula field named totalcashpaid and code:
if {actualguesting.paymentmode}='CASH' then
sum({actualguesting.totalamount})
this is my code in my form:
If ComboBox1.Text = "Shift 1" Then
Dim dt As Date = DateTimePicker1.Text
Dim rpt As New endofshift()
Dim MyCommand As New SqlCommand()
Dim myDS2 As New loghistory()
Dim myDA2 As New SqlDataAdapter()
Dim myDS As New DSactualguesting()
Dim myDA As New SqlDataAdapter()
Dim cn As New SqlConnection(ConnectString())
Try
MyCommand.Connection = cn
MyCommand.CommandText = "Select * from actualguesting where shift = 1 and datecheckin='" + dt + "'"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "actualguesting")
myDA.SelectCommand.CommandText = "Select * from loghistory where username='" + Login.txtuser.Text + "'"
myDA.Fill(myDS, "loghistory")
myDS.EnforceConstraints = False
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
endif
everytime i checked the report,the totalcashpaid amount doubles up eventhough i did not make a transaction. for example i made a transaction that cost 5000, the totalcashpaid is 5000 when i check the report.but when i logout and login with the same account and check the report, it became 10000.what should i do?
this is an end of shift report which is the time varies on my server:
6:00 AM - 2:00 PM = shift 1
2:00 PM - 10:00 PM = shift 2
10:00 PM -6:00 AM = shift 3
that means,i'm on the time of shift 1