我在Visual Studio 2012中使用C#,firebird
是我的数据库。
在DataGridView
中搜索和显示日期范围的代码是什么?
我的数据库程序可能是错误的。请修复我的程序的这行代码。
CREATE PROCEDURE LEAVETRANS_DATESRCH(
BEGIN_DAY SMALLINT,
BEGIN_MONTH SMALLINT,
BEGIN_YEAR SMALLINT,
END_DAY SMALLINT,
END_MONTH SMALLINT,
END_YEAR SMALLINT)
RETURNS(
LEAVETRANS_EMPNAME VARCHAR(50) CHARACTER SET ISO8859_1 COLLATE ISO8859_1,
LEAVETRANS_LEAVENAME VARCHAR(50) CHARACTER SET ISO8859_1 COLLATE ISO8859_1,
LEAVETRANS_DAYS DECIMAL(12, 2),
LEAVETRANS_TIME TIME,
LEAVETRANS_REASON VARCHAR(500) CHARACTER SET ISO8859_1 COLLATE ISO8859_1)
AS
BEGIN
FOR
SELECT
LEAVETRANS_EMPNAME,
LEAVETRANS_LEAVENAME,
LEAVETRANS_DAYS,
LEAVETRANS_TIME,
LEAVETRANS_REASON
FROM LEAVETRANSACTION WHERE LT_DAY =:BEGIN_DAY AND LT_MONTH =:BEGIN_MONTH
AND LT_YEAR =:BEGIN_YEAR OR LT_DAY =:END_DAY AND LT_MONTH =:END_MONTH AND LT_YEAR
=:END_YEAR
INTO
:LEAVETRANS_EMPNAME,
:LEAVETRANS_LEAVENAME,
:LEAVETRANS_DAYS,
:LEAVETRANS_TIME,
:LEAVETRANS_REASON
DO
BEGIN
SUSPEND;
END
END;