Converting numeric date to string, then trimming it

  • Thread starter Thread starter Santiago Gomez
  • Start date Start date
S

Santiago Gomez

I have a table with a date field. I need to group it by month.
I was thinking I could turn the number (37178) into a string (14-Oct-01) and
then trim the left3 and right 3 to just leave Oct.
Then I could group it by month.

Is there a better way of doing this?

what would the SQL statement look like?

thanks
 
Create two calculated fields in your query:
ThisYear: Year([MyDate])
ThisMonth: Month([MyDate])
Group by those fields.

If this query is the source for a report, the Sorting And Grouping dialog is
capable of grouping by month.
 
Easier than you think:

?Format(37178, "mmm")
Oct

Use Allen's Month & Year for Sorting and Grouping in Reports.
 
Back
Top