Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i extract only part of a field

Status
Not open for further replies.

crysma

Programmer
Oct 17, 2002
21
CA
Hi,

I was wonderning if anyone could help me out with a problem I'm having. I've got a database which contains, among other information, the date of registration for clients. These dates are organised in a dd/mm/yyyy format. Is there anyway to extract just the year using a query? I'd like to have the query sorted by year and by client ID. I'd appreciate any suggestions. Thanks in advance,

Sheryll
 
Assuming you're using access, instead of just dragging the field into the query, right click on the space where you would drag the field and select build
Thewn, use the wizard to create
=YEAR([DateFieldName])
This will then return teh year associated with the date field along with any other fields you care to bring thru Rgds
~Geoff~
 
Works like a charm! Thanks Geoff ^^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top