3 Replies Latest reply on May 16, 2007 8:56 AM by insuractive

    CHARTS

    JohnGree
      Hi
      i have a chart i want to produce, i have a table with the column "date" which is a datestamp, what i want is to display months along the bottom ie Jan Feb March etc

      i need my where clause to be ....

      where MONTH(Date) = session.month,

      the session.month is formated as January but the MONTH(Date) is numerical, how can i change the format of numerical date to the format of january?
        • 1. Re: CHARTS
          insuractive Level 3
          Check out the CF date functions in the documentation. I think you'll find MonthAsString() is what you're looking for.
          • 2. Re: CHARTS
            JohnGree Level 1
            ok thanks, i have already tried that using

            WHERE MonthAsString(Month(Date))=#session.Daily#

            but i get the error
            General error: FUNCTION database.MonthAsString does not exist
            • 3. Re: CHARTS
              insuractive Level 3
              Ah, I misunderstood your question. MonthAsString() is a coldfusion function, not a SQL function. What DB are you using? Depending on your database, you will probably have similar functions available to you - take a look in the SQL documentation for you database (look for Date Functions). Otherwise, you could convert session.Daily into its corresponding numeric value with a quick and dirty <cfif>/<cfelseif>/<cfelse> block.