+ 1
I want sql query for fetching data from database where date of birth from current date of the month to end date of the month
8 Answers
+ 4
If I understand your request correctly, you want all records where the DOB date (excluding year) is between today and the end of the month.
CREATE TABLE person (
id int NOT NULL,
dob date NOT NULL,
name varchar(200) NOT NULL,
PRIMARY KEY (id)
)
INSERT INTO person (id, dob, name) VALUES
('1', '3/31/2005', 'Adam'),
('2', '4/1/1995', 'Betty'),
('3', '4/2/1998', 'Charlie'),
('4', '4/15/2001', 'Derek');
select * from person
where month(dob) = month(getdate())
and day(dob) between day(getdate()) and day(eomonth(getdate()))
+ 1
Do you mean something like this?
select * from person where dob between @startdate and @enddate
Sorry, I'm only guessing what you're asking.
0
thank you so much
0
how to use this query...? I mean using variable reference.. plzzz tell me
0
ok thank you
0
how to write code date of birth calculate to age in c# using webform?
0
can any1 gv me d code for generating graph by using database values in .net....?
0
using webforms