Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 7th, 2004, 02:41 PM
ironchef ironchef is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Cleveland
Posts: 112 ironchef User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 14 m 34 sec
Reputation Power: 7
Exclamation date issues in sql

Hi all!

Need some assistance and advice to how to right a little sql statement. Not sure if this is possible, but here we go...

I have a database built in access2000 and a table that tracks volunteer workers and information about them, specifically their birthdays. Now, I'm writing a query, but i need only the months from the volunteers birthdays. So, (mm/dd/yyyy) I need the mm (month) but it needs to be the actual month i.e. 12 = "December" not just 12.

note: the date is stored as mm/dd/yyyy in the table

Thanks in advanced!

Regards,

BAF

Last edited by ironchef : January 7th, 2004 at 02:45 PM.

Reply With Quote
  #2  
Old January 7th, 2004, 09:37 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,954 r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level)r937 User rank is General 1st Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 15 h 39 m 21 sec
Reputation Power: 1024
"the date is stored as mm/dd/yyyy" -- does this mean it's a varchar field?

because if it's a datetime field, you might have entered the dates in that format, but they are actually stored in datetime format (as two integers)

if the date is a varchar field, you should change it immediately

if it's a datetime field, try this:
Code:
select volunteername
     , format(birthday,"MMMM") as birthmonth
  from volunteers
__________________
r937.com | rudy.ca

pre-order my book Simply SQL from Amazon

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > date issues in sql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT