A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Birthday Date



 
 
Thread Tools Display Modes
  #1  
Old July 23rd, 2009, 02:24 PM posted to microsoft.public.access.gettingstarted
John
external usenet poster
 
Posts: 2,649
Default Birthday Date

I have a table that has the Date of Birth field that is set as a text field
that is formated 99/99/00;;_ I need to create a query that returns anyone
whos birth month is equal to the current month. Can anyone help?
  #2  
Old July 23rd, 2009, 03:03 PM posted to microsoft.public.access.gettingstarted
Klatuu
external usenet poster
 
Posts: 7,074
Default Birthday Date

Why are you carrying a date as text? That only makes life harder for you.
There is not advantage to carrying a date as text.

But, to answer your question, assuming the actual field content is in mmddyy
order and today would be represented as 072309, you can use this

WHERE CLng(Left([DOB],2)) = Month(Date)

If you are using an international format of ddmmyy (230709)

It would be

WHERE Clng(Mid([DOB],3,2)) = Month(Date)

And if you were doing it correctly, it would be

WHERE Month([DOB]) = Month(Date)
--
Dave Hargis, Microsoft Access MVP


"john" wrote:

I have a table that has the Date of Birth field that is set as a text field
that is formated 99/99/00;;_ I need to create a query that returns anyone
whos birth month is equal to the current month. Can anyone help?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.