Gossamer Forum
Home : General : Databases and SQL :

last_month_date or something similar in Sybase

Quote Reply
last_month_date or something similar in Sybase
Hi,
I was wondering if anybody knew something in sybase or some code that gave me the last month end date from a table. I kno oracle has last_day function i believe.

I also wanted to kno if there was a way of doing something to get a query back between 2 dates. Lets say i did getdate()-1 and getdate()-3.
and getdate was dec... i would get sept oct and nov data.
But it should work also no matter what month. lets say i did this select next year feb ... i should get jan04 dec03 nov03

I have tried a few i keep getting data that isnt right ... hope somebody can help with something Unsure

Thanks in Advance.
Quote Reply
Re: [llccoo] last_month_date or something similar in Sybase In reply to
For anybody else out there with this question. I was able to figure out the query i wanted using datediff.