×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

DateTime to Month format

DateTime to Month format

DateTime to Month format

(OP)
I have a datetime field in the database, that I need to extract just the month from.  I can do this in Oracle sql but I cannot figure out how to achieve this in MSTR.

At the report front end, I can alter the format of the datetime which will give the Month, but I need to create an attribute to extract the month so that I can use it as a filter in various reports.

This will be hitting a very large table & will return a lot of rows, so an efficient method is preferable if there are options.

Any suggestions?

RE: DateTime to Month format

Try using some of the date functions that are now available in 8.x or you can always use an applysimple to pass the Oracle functions in natively. The new functions in Microstrategy are pretty smart and convert the generic function to the database specific function when it queries the database.

RE: DateTime to Month format

(OP)
Thanks reisw.  I'll take a look at the Applysimple stuff & see if I can make sense of it.  

I spoke to MSTR yesterday who advised creating a solution in the database - ie a new column in the db that extracts the month for me.  In addition to this, they also recommended creating a db table that links on the date, with a column for each appropriate date detail - eg, date; day of week; week_id; month_id; quarter; year.  This will definitely solve the problem, but it seems an awful lot of work when I already have the datetime in a column.

Hopefully, the applysimple will hold the solution.
Cheers,
Jodes.

RE: DateTime to Month format

(OP)
This sorts out the problem:

ApplySimple("concat(to_char(date2, 'YYYY'),(to_char(date2, 'MM')))")

The attribute must have an attribute ID Form, as this applySimple only works as a Description Form.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close