Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Date calculation

$
0
0
Hi,

I want to calculate the following date: Starting from todays date, deducted by one month and the 12th of of that month.

Example:
Today is 15.Nov.2012
Result should be: 12.Oct.2012

Is there any easier way than this one (I did that, but looks quite complex to me for this simple request, there should be an easier way using not so many functions as this will slow down the speed)

Code:

date(trim(Char(YEAR(CURRENT DATE - 1 MONTH)))||'-'|| trim(Char(MONTH(CURRENT DATE - 1 MONTH)))||'-12')
Thanks

Viewing all articles
Browse latest Browse all 13329

Trending Articles