Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change the Date format from MM-DD-YYYY to MM-YYYY

I have imported the data from Teradata table which has a date field in MM-DD-YYYY format, I am building a chart where this field is in X axis , I want the format to be changed to MM-YYYY.

Please let me know if any one knows about it.

Thanks

7 Replies
shree909
Partner - Specialist II
Partner - Specialist II

Hi

Use  the expression as  MonthName(ReadingDate) u willl get as Dec 2013

or using Date(Readingdate,'MM-YYYY') As Date either in script or in the expression of the list box.

If this doesnt work  upload a sample file

Thanks

PradeepReddy
Specialist II
Specialist II

Try something like this..   date(DateField,'MM-YYYY')

Ex: date(today(),'MM-YYYY')

Not applicable
Author

Thanks, I got it.

PradeepReddy
Specialist II
Specialist II

If you got the solution from the posts, please mark the answer as correct..

So that new bees can access solution easily...

jagan
Luminary Alumni
Luminary Alumni

Hi Nasir,


You below expression, use MonthEnd() or MonthStart() to avoid the duplicate month names


=Date(MonthEnd(DateField),'MM-YYYY')


Hope this helps you.


Regards,

Jagan.

Not applicable
Author

Well , the solution for this problem is :

1. go to edit script and upload the data from your QVD file

2. write the code like an SQL statement with the date variable.

For eg:

Load

Date(Date,'MM-YYYY')as Mon_YYYY

from C:\Users\ndurani\desktop\abc.qvd(QVD);

Once the data is uploaded, you can go to the main sheet and build the graph with new chart object.

Not applicable
Author

hi

try this

date(date#(fieldname,'DD-MM-YYYY'),'MM-YYYY')


Regards