This depends on the database that you use as well as on the format of the month/year object - whether it should be 2010-09 or Sep-2010 or 2010 September, or …
I am afraid I was not able to do it. We have one expiration date in the table. Can you or any one please tell me, how could we pull the month and year from the existing date? I need to create one object with month/year . so that we can give prompt to the user on the month/year. we are using the Teradata.
The EXTRACT() function is used like the TO_CHAR() function in Oracle, meaning you can use it to extract (nice name, eh?) different components from a date. The syntax is something like:
Thank you Dave for reply. yes, I came across this function when I was going through the dynamic dates links provided by you under universe design section. But Your reply here helped me to understand how to use the extract function. I tried this one I can able to extract year and month seperatly.But is their anyway I could extract both together? Something like " Extract (year/month from table.date)".
EX: sel extract (year from table.date), extract (month from table.date) ;
The above syntax I am using to get year and month, is there anyway i can get both by using something like this “” Extract (year/month from table.date)".
Extract them separately and then put them back together. I don’t remember the concatenation operator in Teradata, is it || or + or & or something else.
extract(year from table.date) + "-" + extract(month from table.date)