+ 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

1st Apr 2018, 4:36 PM
DODDABASAPPA
DODDABASAPPA - avatar
8 Réponses
+ 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()))
1st Apr 2018, 6:25 PM
ServantCoder
ServantCoder - avatar
+ 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.
3rd Apr 2018, 5:54 AM
ServantCoder
ServantCoder - avatar
0
thank you so much
2nd Apr 2018, 1:57 AM
DODDABASAPPA
DODDABASAPPA - avatar
0
how to use this query...? I mean using variable reference.. plzzz tell me
2nd Apr 2018, 12:03 PM
DODDABASAPPA
DODDABASAPPA - avatar
0
ok thank you
3rd Apr 2018, 7:05 AM
DODDABASAPPA
DODDABASAPPA - avatar
0
how to write code date of birth calculate to age in c# using webform?
3rd Apr 2018, 7:07 AM
DODDABASAPPA
DODDABASAPPA - avatar
0
can any1 gv me d code for generating graph by using database values in .net....?
6th Apr 2018, 5:33 AM
DODDABASAPPA
DODDABASAPPA - avatar
0
using webforms
6th Apr 2018, 5:34 AM
DODDABASAPPA
DODDABASAPPA - avatar