vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Gorazd Hribar Rajterič wrote: > [snip] > >>MDY(MONTH(TODAY + 1 UNITS MONTH),1,YEAR(TODAY))-1 >> > > [snip] > > Using TODAY + 1 UNITS MONTH will fail if today is 31st day of the month and > next month only has 30 days. The same happens on january 29th (if it's not a > leap year), 30th and 31st. You are quite right! That will teach me to cut&paste so hastily from 4GL into SQL. So I guess the full syntax should be something like: MDY ( MONTH(MDY(MONTH(TODAY), 1, YEAR(TODAY)) + 1 UNITS MONTH), 1, YEAR(MDY(MONTH(TODAY), 1, YEAR(TODAY)) + 1 UNITS MONTH) )-1 Cheers, -- Mark. +----------------------------------------------------------+-----------+ | Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /| | Mydas Solutions Ltd http://MydasSolutions.com |///// / //| | +-----------------------------------+//// / ///| | |We value your comments, which have |/// / ////| | |been recorded and automatically |// / /////| | |emailed back to us for our records.|/ ////////| +----------------------+-----------------------------------+-----------+ sending to informix-list |
| Thread Tools | |
| Display Modes | |
|
|