create table emp(id int auto_increment,ename varcahr(50),sl decimal(10,2),DOB datetime)
CREATE TABLE `test`.`emp` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`salary` DECIMAL(10,2) NOT NULL,
`DateOfBirth` DATETIME NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB;
id name salary DateOfBirth
1 A 1000 1986-10-10
2 B 2000 1985-02-08
3 C 3000 1990-01-11
4 D 4000 1980-03-03
1)in asp.net when page loading dispaly all the values in a gridview
2)when i gave a from date form asp.net 1986-10-10 display values DateOfBirth >= FROMDATE
3)when i give to date 1985-01-01 dsiplay values DateOfBirth<= TODATE
4)if give both dates DateOfBirth >= FROMDATE and DateOfBirth<= TODATE display with in these values
5)if give empty text dates dispaly the total table with dates
plz give a stored procedure for this
i am write this procedure but null values not taken it
DELIMITER $$
create procedure getClient(in FROMDATE date,in TODATE date)
begin
SELECT id,name,salary,dateofjoin
FROM emp
where (DateOfBirth <= FROMDATE or FROMDATE is null )/* but here null values not taken like sql*/
AND (DateOfBirth>= TODATE or FROMDATE is null);
end $$
DELIMITER ;