473,700 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Birthday in a query?

Hi, i did a search and find the way to get the birthday without the
year.

My field is yyyy/mm/dd, (birthday). I also have a day field (1 to 31)
and a month field. (1 to 12)

My problem is: I can get the birthday for one month in particular, but
i would like to be able to get birthday for a week that goes over 2
month.

ie: The last week of february 2006.
Sunday is february 26th and Saturday is march fourth. So far nothing
seems to work.

I would like to have something like this : Between [first date: mm/dd]
and [second date: mm/dd].

I cant put this in my birthday field because of the year (i think), i
did try a [Month]/[Day] field but it doesnt work.

any idea???

thx.

Feb 17 '06 #1
5 5211
No***********@h otmail.com wrote:
Hi, i did a search and find the way to get the birthday without the
year.

My field is yyyy/mm/dd, (birthday). I also have a day field (1 to 31)
and a month field. (1 to 12)

My problem is: I can get the birthday for one month in particular, but
i would like to be able to get birthday for a week that goes over 2
month.

ie: The last week of february 2006.
Sunday is february 26th and Saturday is march fourth. So far nothing
seems to work.

I would like to have something like this : Between [first date: mm/dd]
and [second date: mm/dd].

I cant put this in my birthday field because of the year (i think), i
did try a [Month]/[Day] field but it doesnt work.

any idea???

thx.

? datePart("yyyy" ,Date)
2006
? datePart("m",Da te)
2
? datePart("d",Da te)
17
? Month(date)
2
? Day(Date)
17
In your case of going over 2 months, in your example, you'd best compare
for each month.
Where (Month(Birthday ) = 2 And Day(BirthDay) >= 26) Or
(Month(Birthday ) = 3 And Day(BirthDay) <= 4)
Feb 17 '06 #2
thx i'll give it a shot.

Feb 17 '06 #3
SELECT BirthdayTable.B irthday
FROM BirthdayTable
WHERE ((BirthdayTable .Birthday) Between #2/26/2006# And #3/4/2006#);

Feb 17 '06 #4
that wont work, cuz nobody is born in that particular week in 2006 that
work for us. U have to remove the year.

Don't have a working solution sor far but i'll keep thinking about it.

Feb 20 '06 #5
Mal
In a couple of different circumstances I calculate BirthDayThisYea r and then
use that for queries etc.
I use the DateSerial function to create that. --- DateSerial(year , month,
day)
so...
(Air code)
Function BirthDayThisYea r(myBDate As Date)
BirthDayThisYea r = DateSerial(Year (Date), Month(myBDate), Day(myBDate))
BirthDayThisYea r = CDate(BirthDayT hisYear) 'this may be redundant....
End Function

HTH
Mal.
"No***********@ hotmail.com" <ug********@hot mail.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
that wont work, cuz nobody is born in that particular week in 2006 that
work for us. U have to remove the year.

Don't have a working solution sor far but i'll keep thinking about it.

Feb 22 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2144
by: Peter Ruijter | last post by:
Hello, I've read and used the birthday solutions of Wolfgang Führer from the mySQL DATE examples on the mysql.com website. SELECT naam, gebdatum FROM users WHERE gebdatum != '0000-00-00' AND (( DAYOFYEAR(gebdatum) < DAYOFYEAR(now()) )*366)+DAYOFYEAR(gebdatum) >= DAYOFYEAR(now())ORDER BY (( DAYOFYEAR(gebdatum) < DAYOFYEAR(now()) )*366)+DAYOFYEAR(gebdatum)
51
989
by: Sandra | last post by:
I was given this problem for extra credit and I am just stuck ! BTW - I am not asking for source code and I am not asking anyone to do my homework as I do want to learn .. I just need a hint or two to get moving and I need to know if what I have written so far is leading me in the right direction ~ Ok - The problem is to find out how many people need to be in a room for a 95% chance that someone in that room will match my birthday I...
1
3388
by: Claude Alain | last post by:
Hello! We are a small non-profit organisation with about 400 members. We have created a database using Access97 which contains tombstone information on our members, including home adresses and birthdates. We would like to produce monthly reports providing us with a list of all members whose birthdate is coming up during any given month in order to send those members a birthday card in a labelled enveloppe. The best we have come up with...
2
5216
by: edwin van rutten | last post by:
Hi I have a personal database of all adresses etceteras of personal contacts and want to sort the birthday dates in such a way that I have a chronological list for this years birthdays. The problem I now encounter is that the system takes the years into account. I already was thinking of exporting to outlook to get this done, but I think there must be a smarter way
7
15496
by: Adrian | last post by:
I hit on this problem converting a VB.NET insurance application to C#. Age next birthday calculated from date of birth is often needed in insurance premium calculations. Originally done using DateDiff in VB.NET which is only available in C# if you don't mind linking in Microsoft.VisualBasic.dll to your C# application. I wanted to avoid this so set about a pure C# solution which uses a combination of TimeSpan in whole days and the...
2
2483
by: David Garamond | last post by:
What would be the more proper way of storing birthday data? It will be used to send out birthday messages for customers ("Happy 30th birthday, Sam!"). But the date of birth is not necessarily known (in which case, we will only send out "Happy birthday, Sam!"). I prefer using the builtin date type instead of three smallints. But I don't like having to arbitrarily set, say, year 1000 AD or 1 BC to represent "unknown year". Any thoughts?
2
2339
by: Paul H | last post by:
I have a db that stores people and their birth dates. On any given day, I need to know who has a 40th birthday one month from now. I will only be running the query on week days but of course some peoples 40th birthdays will fall on Saturday and Sunday, I may also be out of the office on certain days. So I need to "cast a net" to catch all birthdays "approximately" one month from now, but that "approximation needs to be predictable. How...
13
3694
kestrel
by: kestrel | last post by:
Sheila and He-Man are twins; Sheila is the OLDER twin. Assume they were born immediately after each other, an infinitesimally small - but nonzero - amount of time apart. During one year in the course of their lives, Sheila celebrates her birthday two days AFTER He-Man does. How is this possible? Bonus: What is the maximum amount of time by which Sheila and He-Man can be apart in their birthday celebrations during the same year? I think...
1
2379
by: stilldancin12 | last post by:
Ok so i have to write an application that asks for the users birthday and replies with they day of the week in which he or she is born on, using the java program. This is what I have so far.It gives me the actual birthday, but not the day of the week. I feel like i am just missing one simple line of text but I can't figure out what it is. Any help would be appriciated! package Ch2Scanner; import java.text.SimpleDateFormat; import...
0
8709
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9202
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8952
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5894
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4395
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3081
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2371
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.