尝试合计支付金额时显示错误值的总和

watbbzwu  于 2021-07-26  发布在  Java
关注(0)|答案(1)|浏览(332)

我正在使用sales表来保存帐单号码、已付金额等。
我使用相同的数据在我的web应用程序中生成收入报告,其中显示了正确的账单数量和金额。
但当我试图在 Jmeter 板上求和时,它显示的总量是不同的。
用于生成收入报告的代码:

protected void btnLoad_Click(object sender, EventArgs e)
{
    Button lnkshow = (Button)sender;
    SqlConnection CN;
    string MyConnectionString = null;
    MyConnectionString = constring;
    CN = new SqlConnection(MyConnectionString);
    CN.Open();
    string SQL = null;
    SQL = "SELECT distinct(bno),name,mobile,cdate,paid FROM transacts WHERE CONVERT(DATETIME,cdate,103) BETWEEN CONVERT(DATETIME,'" + txtFromDate.Text + "',103) AND CONVERT(DATETIME,'" + txtToDate.Text + "',103) and bno>19999";
    SqlDataAdapter myDA = new SqlDataAdapter(SQL, CN);
    CN.Close();
    SCCDataset DS = new SCCDataset();
    myDA.Fill(DS, "transacts");
    ReportDocument myRPT = new ReportDocument();
    myRPT.Load(Server.MapPath("Reports/Income.rpt"));
    myRPT.SetDataSource(DS);
    rptIncomeReport.ReportSource = myRPT;
    rptIncomeReport.SeparatePages = false;

}

用于在 Jmeter 板中显示总计的代码:

public void TotalSales()
{
    using (SqlConnection con = new SqlConnection(constring))
    {
        string query = "select sum(distinct(cast(isnull(paid, '0') as decimal(18, 2)))) as 'total' from transacts where cdate='" + systemdate + "'";
        con.Open();
        using (SqlCommand cmd = new SqlCommand(query, con))
        {
            using (SqlDataReader dr = cmd.ExecuteReader())
            {
                while (dr.Read())
                {
                    if(!string.IsNullOrEmpty(dr["total"].ToString()))
                    {
                        totSales.InnerText = "₹" + dr["total"].ToString();
                    }
                    else
                    {
                        totSales.InnerText = "0";
                    }
                }
            }
        }
        con.Close();
    }
}

Jmeter 板中的结果:

收入报告结果:

我已经生成了包含数据的表脚本,供您参考:

USE [DatabaseName]
GO
/******Object:  Table [dbo].[transacts]    Script Date: 15-07-2020 12:01:45 PM******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[transacts](
    [id] [bigint] IDENTITY(1,1) NOT NULL,
    [bno] [varchar](10) NULL,
    [cdate] [varchar](50) NULL,
    [ctime] [varchar](50) NULL,
    [name] [varchar](200) NULL,
    [mobile] [varchar](20) NULL,
    [address] [nvarchar](max) NULL,
    [vehicle] [varchar](100) NULL,
    [vehicleno] [varchar](20) NULL,
    [rim] [varchar](50) NULL,
    [lmr] [varchar](50) NULL,
    [cmr] [varchar](50) NULL,
    [nxtserv] [varchar](50) NULL,
    [services] [varchar](200) NULL,
    [qtty] [varchar](10) NULL,
    [price] [varchar](50) NULL,
    [weight] [varchar](50) NULL,
    [linetotal] [varchar](50) NULL,
    [total] [varchar](50) NULL,
    [payable] [varchar](50) NULL,
    [paid] [varchar](50) NULL,
    [bal] [varchar](50) NULL,
    [pymtmode] [varchar](50) NULL,
    [status] [varchar](2) NULL,
    [rem] [varchar](2) NULL,
 CONSTRAINT [PK_transacts] PRIMARY KEY CLUSTERED
(
    [id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[transacts] ON

INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (1, N'20000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3672, N'21754', N'14-07-2020', N'08:04:33 AM', N'D S PADAGUNUR', N'7975455046', NULL, N'SWIFT', N'MH 12 JU 1380', N'--Select--', N'220306', NULL, N'225306', N'ALIGNMENT', N'1', N'350', N'', N'350.00', N'975.00', N'975.00', N'975.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3673, N'21754', N'14-07-2020', N'08:04:33 AM', N'D S PADAGUNUR', N'7975455046', NULL, N'SWIFT', N'MH 12 JU 1380', N'--Select--', N'220306', NULL, N'225306', N'WHEEL BALANCING', N'2', N'70', N'', N'140.00', N'975.00', N'975.00', N'975.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3674, N'21754', N'14-07-2020', N'08:04:33 AM', N'D S PADAGUNUR', N'7975455046', NULL, N'SWIFT', N'MH 12 JU 1380', N'--Select--', N'220306', NULL, N'225306', N'WEIGHT(gms)', N'90', N'1.50', N'', N'135.00', N'975.00', N'975.00', N'975.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3675, N'21754', N'14-07-2020', N'08:04:33 AM', N'D S PADAGUNUR', N'7975455046', NULL, N'SWIFT', N'MH 12 JU 1380', N'--Select--', N'220306', NULL, N'225306', N'WASHING', N'1', N'350', N'', N'350.00', N'975.00', N'975.00', N'975.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3676, N'21755', N'14-07-2020', N'08:43:58 AM', N'ANWAR', N'9880563992', NULL, N'RITZ', N'MH 26 V 2530', N'NA', N'111962', NULL, N'118039', N'ALIGNMENT', N'1', N'350', N'', N'350.00', N'730.00', N'730.00', N'730.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3677, N'21755', N'14-07-2020', N'08:43:58 AM', N'ANWAR', N'9880563992', NULL, N'RITZ', N'MH 26 V 2530', N'NA', N'111962', NULL, N'118039', N'WHEEL BALANCING', N'2', N'70', N'', N'140.00', N'730.00', N'730.00', N'730.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3678, N'21755', N'14-07-2020', N'08:43:58 AM', N'ANWAR', N'9880563992', NULL, N'RITZ', N'MH 26 V 2530', N'NA', N'111962', NULL, N'118039', N'WEIGHT(gms)', N'80', N'1.50', N'', N'120.00', N'730.00', N'730.00', N'730.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3679, N'21755', N'14-07-2020', N'08:43:58 AM', N'ANWAR', N'9880563992', NULL, N'RITZ', N'MH 26 V 2530', N'NA', N'111962', NULL, N'118039', N'TYRE CHANGE', N'2', N'60', N'', N'120.00', N'730.00', N'730.00', N'730.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3680, N'21756', N'14-07-2020', N'08:56:06 AM', N'JADHAV', N'9844945378', NULL, N'CRETA', N' MH 09 FB 6901', N'NA', N'29654', NULL, N'29654', N'WASHING', N'1', N'300', N'', N'300.00', N'300.00', N'300.00', N'300.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3681, N'21757', N'14-07-2020', N'09:10:21 AM', N'VIKRAM', N'8838284145', NULL, N'SWIFT', N'TN 45 AV 1545', N'--Select--', N'', NULL, N'5000', N'WASHING', N'1', N'350', N'', N'350', N'350', N'350', N'350', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3682, N'21758', N'14-07-2020', N'09:45:49 AM', N'CASH', N'9999999999', NULL, N'ERTIGA', N'A', N'--Select--', N'', NULL, N'5000', N'WASHING', N'1', N'350', N'', N'350', N'350', N'350', N'350', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3683, N'21759', N'14-07-2020', N'09:48:23 AM', N'S B KORE', N'9164389015', NULL, N'BEAT', N'KA25 P 9389', N'--Select--', N'74000', NULL, N'79000', N'ALIGNMENT', N'1', N'350', N'', N'350.00', N'610.00', N'610.00', N'610.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3684, N'21759', N'14-07-2020', N'09:48:23 AM', N'S B KORE', N'9164389015', NULL, N'BEAT', N'KA25 P 9389', N'--Select--', N'74000', NULL, N'79000', N'WHEEL BALANCING', N'2', N'70', N'', N'140.00', N'610.00', N'610.00', N'610.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3685, N'21759', N'14-07-2020', N'09:48:23 AM', N'S B KORE', N'9164389015', NULL, N'BEAT', N'KA25 P 9389', N'--Select--', N'74000', NULL, N'79000', N'WEIGHT(gms)', N'80', N'1.50', N'', N'120.00', N'610.00', N'610.00', N'610.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3686, N'21760', N'14-07-2020', N'10:16:04 AM', N'CASH', N'9999999999', NULL, N'INNOVA', N'KA 28 Z 2430', N'--Select--', N'', NULL, N'5000', N'WASHING', N'1', N'350', N'', N'350.00', N'350.00', N'350.00', N'350.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3687, N'21761', N'14-07-2020', N'10:20:43 AM', N'CASH', N'9999999999', NULL, N'SWIFT', N'KA 33 M 3949', N'--Select--', N'307959', NULL, N'312959', N'ALIGNMENT', N'1', N'350', N'', N'350.00', N'960.00', N'960.00', N'960.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3688, N'21761', N'14-07-2020', N'10:20:43 AM', N'CASH', N'9999999999', NULL, N'SWIFT', N'KA 33 M 3949', N'--Select--', N'307959', NULL, N'312959', N'WHEEL BALANCING', N'2', N'70', N'', N'140.00', N'960.00', N'960.00', N'960.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3689, N'21761', N'14-07-2020', N'10:20:43 AM', N'CASH', N'9999999999', NULL, N'SWIFT', N'KA 33 M 3949', N'--Select--', N'307959', NULL, N'312959', N'WEIGHT(gms)', N'80', N'1.50', N'', N'120.00', N'960.00', N'960.00', N'960.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3690, N'21761', N'14-07-2020', N'10:20:43 AM', N'CASH', N'9999999999', NULL, N'SWIFT', N'KA 33 M 3949', N'--Select--', N'307959', NULL, N'312959', N'WASHING', N'1', N'350', N'', N'350.00', N'960.00', N'960.00', N'960.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3691, N'21762', N'14-07-2020', N'10:59:56 AM', N'CASH', N'9999999999', NULL, N'INNOVA', N'A', N'--Select--', N'', NULL, N'5000', N'WASHING', N'1', N'400', N'', N'400.00', N'400.00', N'400.00', N'400.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3692, N'21763', N'14-07-2020', N'11:01:57 AM', N'R S BIRADAR', N'9901596858', NULL, N'ERTIGA', N'KA 09 MB 5110', N'--Select--', N'104668', NULL, N'109668', N'ALIGNMENT', N'1', N'350', N'', N'350', N'350', N'350', N'350', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3693, N'21764', N'14-07-2020', N'01:27:10 PM', N'CHAVAN', N'8431183105', NULL, N'ZEST', N'KA 28 D 2858', N'--Select--', N'68177', NULL, N'73177', N'ALIGNMENT', N'1', N'300', N'', N'300.00', N'300.00', N'300.00', N'300.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3694, N'21765', N'14-07-2020', N'01:28:12 PM', N'A', N'9999999999', NULL, N'I20', N'KA 28 P 4259', N'--Select--', N'', NULL, N'5000', N'WASHING', N'1', N'350', N'', N'350', N'350', N'350', N'350', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3695, N'21766', N'14-07-2020', N'01:31:00 PM', N'S INDI', N'8884888661', NULL, N'SWIFT', N'KA 27 D 8547', N'--Select--', N'171744', NULL, N'176744', N'ALIGNMENT', N'1', N'300', N'', N'300.00', N'500.00', N'500.00', N'500.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3696, N'21766', N'14-07-2020', N'01:31:00 PM', N'S INDI', N'8884888661', NULL, N'SWIFT', N'KA 27 D 8547', N'--Select--', N'171744', NULL, N'176744', N'WHEEL BALANCING', N'2', N'70', N'', N'140.00', N'500.00', N'500.00', N'500.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3697, N'21766', N'14-07-2020', N'01:31:00 PM', N'S INDI', N'8884888661', NULL, N'SWIFT', N'KA 27 D 8547', N'--Select--', N'171744', NULL, N'176744', N'WEIGHT(gms)', N'40', N'1.50', N'', N'60.00', N'500.00', N'500.00', N'500.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3698, N'21767', N'14-07-2020', N'02:08:49 PM', N'VIKAS HOSMANI', N'9036358901', NULL, N'TATA ACE', N'KA 28 B 7674', N'--Select--', N'12259', NULL, N'17259', N'ALIGNMENT', N'1', N'300', N'', N'300.00', N'300.00', N'300.00', N'300.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3699, N'21768', N'14-07-2020', N'02:46:34 PM', N'MUSTAQ', N'9900292097', NULL, N'SWIFT', N'KA 25 MC 2164', N'--Select--', N'44536', NULL, N'49536', N'ALIGNMENT', N'1', N'350', N'', N'350', N'350', N'350', N'350', N'0', N'Cash', N'0', N'1')
GO
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3700, N'21769', N'14-07-2020', N'02:50:16 PM', N'SALIM ', N'9856854777', NULL, N'KIA', N'KA 28 Z 5548', N'--Select--', N'', NULL, N'5000', N'WASHING', N'1', N'350', N'', N'350', N'350', N'350', N'350', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3701, N'21770', N'14-07-2020', N'03:21:11 PM', N'CASH', N'9844840064', NULL, N'CIZA', N'KA 13 C 1222', N'--Select--', N'', NULL, N'5000', N'WASHING', N'1', N'350', N'', N'350', N'350', N'350', N'350', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3702, N'21771', N'14-07-2020', N'03:52:22 PM', N'XYZ', N'9999999999', NULL, N'XUV 500', N'A', N'--Select--', N'', NULL, N'5000', N'AC CLEANING', N'1', N'500', N'', N'500.00', N'1900.00', N'1900.00', N'1900.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3703, N'21771', N'14-07-2020', N'03:52:22 PM', N'XYZ', N'9999999999', NULL, N'XUV 500', N'A', N'--Select--', N'', NULL, N'5000', N'WASHING', N'1', N'400', N'', N'400.00', N'1900.00', N'1900.00', N'1900.00', N'0', N'Cash', N'0', N'1')
INSERT [dbo].[transacts] ([id], [bno], [cdate], [ctime], [name], [mobile], [address], [vehicle], [vehicleno], [rim], [lmr], [cmr], [nxtserv], [services], [qtty], [price], [weight], [linetotal], [total], [payable], [paid], [bal], [pymtmode], [status], [rem]) VALUES (3704, N'21771', N'14-07-2020', N'03:52:22 PM', N'XYZ', N'9999999999', NULL, N'XUV 500', N'A', N'--Select--', N'', NULL, N'5000', N'INTERIOR CLEANING', N'1', N'1000', N'', N'1000.00', N'1900.00', N'1900.00', N'1900.00', N'0', N'Cash', N'0', N'1')
SET IDENTITY_INSERT [dbo].[transacts] OFF
pprl5pva

pprl5pva1#

问题出在select命令中。你在总数中使用了“distinct”。因此,不考虑重复值(350、300等)。删除“distinct”子句。

相关问题