• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CHARTS

Guest
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

251

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

Check out the CF date functions in the documentation. I think you'll find MonthAsString() is what you're looking for.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 16, 2007 May 16, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation