建表语句
CREATE TABLE [Report_Day] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[ReportDay] [datetime] NULL ,
[city] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
[todayAdd] [int] NULL ,
[todayDel] [int] NULL ,
[todayAddDel] [int] NULL ,
[insertdate] [datetime] NULL CONSTRAINT [DF_Report_Day_insertdate] DEFAULT (getdate()),
CONSTRAINT [PK_Report_Day] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY]
) ON [PRIMARY]
GOCREATE TABLE [Report_Month] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[ReportDay] [datetime] NULL ,
[city] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
[FeeUser] [int] NULL ,//总数
[MonthAdd] [int] NULL ,
[MonthDell] [int] NULL ,
[insertDate] [datetime] NULL CONSTRAINT [DF_Report_Month_insertDate] DEFAULT (getdate()),
CONSTRAINT [PK_Report_Month] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY]
) ON [PRIMARY]
GO请大家帮忙,
CREATE TABLE [Report_Day] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[ReportDay] [datetime] NULL ,
[city] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
[todayAdd] [int] NULL ,
[todayDel] [int] NULL ,
[todayAddDel] [int] NULL ,
[insertdate] [datetime] NULL CONSTRAINT [DF_Report_Day_insertdate] DEFAULT (getdate()),
CONSTRAINT [PK_Report_Day] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY]
) ON [PRIMARY]
GOCREATE TABLE [Report_Month] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[ReportDay] [datetime] NULL ,
[city] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
[FeeUser] [int] NULL ,//总数
[MonthAdd] [int] NULL ,
[MonthDell] [int] NULL ,
[insertDate] [datetime] NULL CONSTRAINT [DF_Report_Month_insertDate] DEFAULT (getdate()),
CONSTRAINT [PK_Report_Month] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY]
) ON [PRIMARY]
GO请大家帮忙,
用主副报表显示,,主报表显示月的,子报表显示日看下面-主副报表关联显示
http://blog.csdn.net/happy09li/article/details/6931959