|
I have a query which I'm trying to convert Oracle date format to a MM - YYYY so I can group by month and year before I pull it to the sql server for results... the format and grouping needs to take place before it comes to sql... The TO_CHAR Oracle syntax gives an error in the formatting section of MON in the attached code. I've tried two single quotes and the Full word Month with no success
(comments are locked)
|
|
I believe that your set @sqlQuery part should have 'MON, YYYY' spelled as ''''MON, YYYY'''', like this: Oleg Thank you - that was the trick oleg!!!
Oct 21 '10 at 03:35 PM
siera_gld
(comments are locked)
|


Just a question - why does the date have to be converted before coming to sql server? You could do it when the data arrives too you know.
There is a huge efficiency benefit to only bringing in data you need - The oracle server is a transactional system and I dont need that level of detail in my results - one item took over 4 minutes to render from this system.
@siera_gld In this case you might want to consider removing the line reading
from your select because now you return both the datetime column and its MON - YYYY representation. By the way, did adding 3 single quotes on either side of the 'MON, YYYY' (like in my answer) help to resolve the problem?