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!

Date Formatting

Status
Not open for further replies.

rknmsp

Programmer
Sep 9, 2004
9
US
I have a result set that includes a date field, currently in mm/dd/yyyy format. I need to group according to mm/yyyy format. The issue is under mm/yyyy format is is reading the date field like a string value. So 1/2006 comes before 3/2005 and 12/2007 will come before 6/2006. Does anyone know how to group in mm/yyyy format, but have it sort in proper date ascending order?

Thanks
 
If it's reading it as a string, then it's not a date field. A Date field implies a specific data type of a field, not the contents.

If it is a date field, then you can insert the field as a group and select for each month.

If it is a string, you can create a formula to convert it to a date and group on the date such as:

cdate(val(mid({table.field},7,4)),val(mid({table.field},1,2)),val(mid({table.field},4,2)))

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top